3 #define PY_SSIZE_T_CLEAN 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) 8 #error Cython requires Python 2.6+ or Python 3.2+. 10 #define CYTHON_ABI "0_25_2" 13 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 15 #if !defined(WIN32) && !defined(MS_WINDOWS) 27 #define DL_IMPORT(t) t 30 #define DL_EXPORT(t) t 32 #ifndef HAVE_LONG_LONG 33 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000) 34 #define HAVE_LONG_LONG 38 #define PY_LONG_LONG LONG_LONG 41 #define Py_HUGE_VAL HUGE_VAL 44 #define CYTHON_COMPILING_IN_PYPY 1 45 #define CYTHON_COMPILING_IN_PYSTON 0 46 #define CYTHON_COMPILING_IN_CPYTHON 0 47 #undef CYTHON_USE_TYPE_SLOTS 48 #define CYTHON_USE_TYPE_SLOTS 0 49 #undef CYTHON_USE_ASYNC_SLOTS 50 #define CYTHON_USE_ASYNC_SLOTS 0 51 #undef CYTHON_USE_PYLIST_INTERNALS 52 #define CYTHON_USE_PYLIST_INTERNALS 0 53 #undef CYTHON_USE_UNICODE_INTERNALS 54 #define CYTHON_USE_UNICODE_INTERNALS 0 55 #undef CYTHON_USE_UNICODE_WRITER 56 #define CYTHON_USE_UNICODE_WRITER 0 57 #undef CYTHON_USE_PYLONG_INTERNALS 58 #define CYTHON_USE_PYLONG_INTERNALS 0 59 #undef CYTHON_AVOID_BORROWED_REFS 60 #define CYTHON_AVOID_BORROWED_REFS 1 61 #undef CYTHON_ASSUME_SAFE_MACROS 62 #define CYTHON_ASSUME_SAFE_MACROS 0 63 #undef CYTHON_UNPACK_METHODS 64 #define CYTHON_UNPACK_METHODS 0 65 #undef CYTHON_FAST_THREAD_STATE 66 #define CYTHON_FAST_THREAD_STATE 0 67 #undef CYTHON_FAST_PYCALL 68 #define CYTHON_FAST_PYCALL 0 69 #elif defined(PYSTON_VERSION) 70 #define CYTHON_COMPILING_IN_PYPY 0 71 #define CYTHON_COMPILING_IN_PYSTON 1 72 #define CYTHON_COMPILING_IN_CPYTHON 0 73 #ifndef CYTHON_USE_TYPE_SLOTS 74 #define CYTHON_USE_TYPE_SLOTS 1 76 #undef CYTHON_USE_ASYNC_SLOTS 77 #define CYTHON_USE_ASYNC_SLOTS 0 78 #undef CYTHON_USE_PYLIST_INTERNALS 79 #define CYTHON_USE_PYLIST_INTERNALS 0 80 #ifndef CYTHON_USE_UNICODE_INTERNALS 81 #define CYTHON_USE_UNICODE_INTERNALS 1 83 #undef CYTHON_USE_UNICODE_WRITER 84 #define CYTHON_USE_UNICODE_WRITER 0 85 #undef CYTHON_USE_PYLONG_INTERNALS 86 #define CYTHON_USE_PYLONG_INTERNALS 0 87 #ifndef CYTHON_AVOID_BORROWED_REFS 88 #define CYTHON_AVOID_BORROWED_REFS 0 90 #ifndef CYTHON_ASSUME_SAFE_MACROS 91 #define CYTHON_ASSUME_SAFE_MACROS 1 93 #ifndef CYTHON_UNPACK_METHODS 94 #define CYTHON_UNPACK_METHODS 1 96 #undef CYTHON_FAST_THREAD_STATE 97 #define CYTHON_FAST_THREAD_STATE 0 98 #undef CYTHON_FAST_PYCALL 99 #define CYTHON_FAST_PYCALL 0 101 #define CYTHON_COMPILING_IN_PYPY 0 102 #define CYTHON_COMPILING_IN_PYSTON 0 103 #define CYTHON_COMPILING_IN_CPYTHON 1 104 #ifndef CYTHON_USE_TYPE_SLOTS 105 #define CYTHON_USE_TYPE_SLOTS 1 107 #if PY_MAJOR_VERSION < 3 108 #undef CYTHON_USE_ASYNC_SLOTS 109 #define CYTHON_USE_ASYNC_SLOTS 0 110 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 111 #define CYTHON_USE_ASYNC_SLOTS 1 113 #if PY_VERSION_HEX < 0x02070000 114 #undef CYTHON_USE_PYLONG_INTERNALS 115 #define CYTHON_USE_PYLONG_INTERNALS 0 116 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 117 #define CYTHON_USE_PYLONG_INTERNALS 1 119 #ifndef CYTHON_USE_PYLIST_INTERNALS 120 #define CYTHON_USE_PYLIST_INTERNALS 1 122 #ifndef CYTHON_USE_UNICODE_INTERNALS 123 #define CYTHON_USE_UNICODE_INTERNALS 1 125 #if PY_VERSION_HEX < 0x030300F0 126 #undef CYTHON_USE_UNICODE_WRITER 127 #define CYTHON_USE_UNICODE_WRITER 0 128 #elif !defined(CYTHON_USE_UNICODE_WRITER) 129 #define CYTHON_USE_UNICODE_WRITER 1 131 #ifndef CYTHON_AVOID_BORROWED_REFS 132 #define CYTHON_AVOID_BORROWED_REFS 0 134 #ifndef CYTHON_ASSUME_SAFE_MACROS 135 #define CYTHON_ASSUME_SAFE_MACROS 1 137 #ifndef CYTHON_UNPACK_METHODS 138 #define CYTHON_UNPACK_METHODS 1 140 #ifndef CYTHON_FAST_THREAD_STATE 141 #define CYTHON_FAST_THREAD_STATE 1 143 #ifndef CYTHON_FAST_PYCALL 144 #define CYTHON_FAST_PYCALL 1 147 #if !defined(CYTHON_FAST_PYCCALL) 148 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 150 #if CYTHON_USE_PYLONG_INTERNALS 151 #include "longintrepr.h" 156 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 157 #define Py_OptimizeFlag 0 159 #define __PYX_BUILD_PY_SSIZE_T "n" 160 #define CYTHON_FORMAT_SSIZE_T "z" 161 #if PY_MAJOR_VERSION < 3 162 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 163 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 164 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 165 #define __Pyx_DefaultClassType PyClass_Type 167 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 168 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 169 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 170 #define __Pyx_DefaultClassType PyType_Type 172 #ifndef Py_TPFLAGS_CHECKTYPES 173 #define Py_TPFLAGS_CHECKTYPES 0 175 #ifndef Py_TPFLAGS_HAVE_INDEX 176 #define Py_TPFLAGS_HAVE_INDEX 0 178 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 179 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 181 #ifndef Py_TPFLAGS_HAVE_FINALIZE 182 #define Py_TPFLAGS_HAVE_FINALIZE 0 184 #ifndef METH_FASTCALL 185 #define METH_FASTCALL 0x80 186 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject **args,
187 Py_ssize_t nargs, PyObject *kwnames);
189 #define __Pyx_PyCFunctionFast _PyCFunctionFast 191 #if CYTHON_FAST_PYCCALL 192 #define __Pyx_PyFastCFunction_Check(func)\ 193 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST))))) 195 #define __Pyx_PyFastCFunction_Check(func) 0 197 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 198 #define CYTHON_PEP393_ENABLED 1 199 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 200 0 : _PyUnicode_Ready((PyObject *)(op))) 201 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 202 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 203 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 204 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 205 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 206 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 207 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 208 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 210 #define CYTHON_PEP393_ENABLED 0 211 #define PyUnicode_1BYTE_KIND 1 212 #define PyUnicode_2BYTE_KIND 2 213 #define PyUnicode_4BYTE_KIND 4 214 #define __Pyx_PyUnicode_READY(op) (0) 215 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 216 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 217 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 218 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 219 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 220 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 221 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 222 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 224 #if CYTHON_COMPILING_IN_PYPY 225 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 226 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 228 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 229 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 230 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 232 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 233 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 235 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 236 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 238 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 239 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 241 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 242 #define PyObject_Malloc(s) PyMem_Malloc(s) 243 #define PyObject_Free(p) PyMem_Free(p) 244 #define PyObject_Realloc(p) PyMem_Realloc(p) 246 #if CYTHON_COMPILING_IN_PYSTON 247 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 248 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 250 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 251 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 253 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 254 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 255 #if PY_MAJOR_VERSION >= 3 256 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 258 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 260 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 261 #define PyObject_ASCII(o) PyObject_Repr(o) 263 #if PY_MAJOR_VERSION >= 3 264 #define PyBaseString_Type PyUnicode_Type 265 #define PyStringObject PyUnicodeObject 266 #define PyString_Type PyUnicode_Type 267 #define PyString_Check PyUnicode_Check 268 #define PyString_CheckExact PyUnicode_CheckExact 270 #if PY_MAJOR_VERSION >= 3 271 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 272 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 274 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 275 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 277 #ifndef PySet_CheckExact 278 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 280 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 281 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 282 #if PY_MAJOR_VERSION >= 3 283 #define PyIntObject PyLongObject 284 #define PyInt_Type PyLong_Type 285 #define PyInt_Check(op) PyLong_Check(op) 286 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 287 #define PyInt_FromString PyLong_FromString 288 #define PyInt_FromUnicode PyLong_FromUnicode 289 #define PyInt_FromLong PyLong_FromLong 290 #define PyInt_FromSize_t PyLong_FromSize_t 291 #define PyInt_FromSsize_t PyLong_FromSsize_t 292 #define PyInt_AsLong PyLong_AsLong 293 #define PyInt_AS_LONG PyLong_AS_LONG 294 #define PyInt_AsSsize_t PyLong_AsSsize_t 295 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 296 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 297 #define PyNumber_Int PyNumber_Long 299 #if PY_MAJOR_VERSION >= 3 300 #define PyBoolObject PyLongObject 302 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 303 #ifndef PyUnicode_InternFromString 304 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 307 #if PY_VERSION_HEX < 0x030200A4 308 typedef long Py_hash_t;
309 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 310 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 312 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 313 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 315 #if PY_MAJOR_VERSION >= 3 316 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) 318 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 320 #if CYTHON_USE_ASYNC_SLOTS 321 #if PY_VERSION_HEX >= 0x030500B1 322 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 323 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 329 } __Pyx_PyAsyncMethodsStruct;
330 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 333 #define __Pyx_PyType_AsAsync(obj) NULL 335 #ifndef CYTHON_RESTRICT 336 #if defined(__GNUC__) 337 #define CYTHON_RESTRICT __restrict__ 338 #elif defined(_MSC_VER) && _MSC_VER >= 1400 339 #define CYTHON_RESTRICT __restrict 340 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 341 #define CYTHON_RESTRICT restrict 343 #define CYTHON_RESTRICT 346 #ifndef CYTHON_UNUSED 347 # if defined(__GNUC__) 348 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 349 # define CYTHON_UNUSED __attribute__ ((__unused__)) 351 # define CYTHON_UNUSED 353 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 354 # define CYTHON_UNUSED __attribute__ ((__unused__)) 356 # define CYTHON_UNUSED 359 #ifndef CYTHON_MAYBE_UNUSED_VAR 360 # if defined(__cplusplus) 361 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
363 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 366 #ifndef CYTHON_NCP_UNUSED 367 # if CYTHON_COMPILING_IN_CPYTHON 368 # define CYTHON_NCP_UNUSED 370 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 373 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 375 #ifndef CYTHON_INLINE 376 #if defined(__clang__) 377 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 378 #elif defined(__GNUC__) 379 #define CYTHON_INLINE __inline__ 380 #elif defined(_MSC_VER) 381 #define CYTHON_INLINE __inline 382 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 383 #define CYTHON_INLINE inline 385 #define CYTHON_INLINE 389 #if defined(WIN32) || defined(MS_WINDOWS) 390 #define _USE_MATH_DEFINES 394 #define __PYX_NAN() ((float) NAN) 396 static CYTHON_INLINE
float __PYX_NAN() {
398 memset(&value, 0xFF,
sizeof(value));
402 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 403 #define __Pyx_truncl trunc 405 #define __Pyx_truncl truncl 409 #define __PYX_ERR(f_index, lineno, Ln_error) \ 411 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 414 #if PY_MAJOR_VERSION >= 3 415 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 416 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 418 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 419 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 422 #ifndef __PYX_EXTERN_C 424 #define __PYX_EXTERN_C extern "C" 426 #define __PYX_EXTERN_C extern 430 #define __PYX_HAVE__subsurfaceTransportFunctions 431 #define __PYX_HAVE_API__subsurfaceTransportFunctions 435 #include "numpy/arrayobject.h" 436 #include "numpy/ufuncobject.h" 442 #ifdef PYREX_WITHOUT_ASSERTIONS 443 #define CYTHON_WITHOUT_ASSERTIONS 446 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
447 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
449 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 450 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 451 #define __PYX_DEFAULT_STRING_ENCODING "" 452 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 453 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 454 #define __Pyx_uchar_cast(c) ((unsigned char)c) 455 #define __Pyx_long_cast(x) ((long)x) 456 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 457 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 458 (sizeof(type) > sizeof(Py_ssize_t) &&\ 459 likely(v < (type)PY_SSIZE_T_MAX ||\ 460 v == (type)PY_SSIZE_T_MAX) &&\ 461 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 462 v == (type)PY_SSIZE_T_MIN))) ||\ 463 (sizeof(type) == sizeof(Py_ssize_t) &&\ 464 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 465 v == (type)PY_SSIZE_T_MAX))) ) 466 #if defined (__cplusplus) && __cplusplus >= 201103L 468 #define __Pyx_sst_abs(value) std::abs(value) 469 #elif SIZEOF_INT >= SIZEOF_SIZE_T 470 #define __Pyx_sst_abs(value) abs(value) 471 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 472 #define __Pyx_sst_abs(value) labs(value) 473 #elif defined (_MSC_VER) && defined (_M_X64) 474 #define __Pyx_sst_abs(value) _abs64(value) 475 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 476 #define __Pyx_sst_abs(value) llabs(value) 477 #elif defined (__GNUC__) 478 #define __Pyx_sst_abs(value) __builtin_llabs(value) 480 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 482 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject*);
483 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
484 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 485 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 486 #define __Pyx_PyBytes_FromString PyBytes_FromString 487 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 488 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
489 #if PY_MAJOR_VERSION < 3 490 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 491 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 493 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 494 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 496 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 497 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 498 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 499 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 500 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 501 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 502 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 503 #if PY_MAJOR_VERSION < 3 504 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u)
506 const Py_UNICODE *u_end = u;
508 return (
size_t)(u_end - u - 1);
511 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen 513 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 514 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 515 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 516 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 517 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 518 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) 519 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
520 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
521 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
522 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
523 #if CYTHON_ASSUME_SAFE_MACROS 524 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 526 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 528 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 529 #if PY_MAJOR_VERSION >= 3 530 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 532 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 534 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 535 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 536 static int __Pyx_sys_getdefaultencoding_not_ascii;
537 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
539 PyObject* default_encoding = NULL;
540 PyObject* ascii_chars_u = NULL;
541 PyObject* ascii_chars_b = NULL;
542 const char* default_encoding_c;
543 sys = PyImport_ImportModule(
"sys");
545 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
547 if (!default_encoding)
goto bad;
548 default_encoding_c = PyBytes_AsString(default_encoding);
549 if (!default_encoding_c)
goto bad;
550 if (strcmp(default_encoding_c,
"ascii") == 0) {
551 __Pyx_sys_getdefaultencoding_not_ascii = 0;
553 char ascii_chars[128];
555 for (c = 0; c < 128; c++) {
558 __Pyx_sys_getdefaultencoding_not_ascii = 1;
559 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
560 if (!ascii_chars_u)
goto bad;
561 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
562 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
565 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
569 Py_DECREF(ascii_chars_u);
570 Py_DECREF(ascii_chars_b);
572 Py_DECREF(default_encoding);
575 Py_XDECREF(default_encoding);
576 Py_XDECREF(ascii_chars_u);
577 Py_XDECREF(ascii_chars_b);
581 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 582 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 584 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 585 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 586 static char* __PYX_DEFAULT_STRING_ENCODING;
587 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
589 PyObject* default_encoding = NULL;
590 char* default_encoding_c;
591 sys = PyImport_ImportModule(
"sys");
593 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
595 if (!default_encoding)
goto bad;
596 default_encoding_c = PyBytes_AsString(default_encoding);
597 if (!default_encoding_c)
goto bad;
598 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
599 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
600 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
601 Py_DECREF(default_encoding);
604 Py_XDECREF(default_encoding);
612 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 613 #define likely(x) __builtin_expect(!!(x), 1) 614 #define unlikely(x) __builtin_expect(!!(x), 0) 616 #define likely(x) (x) 617 #define unlikely(x) (x) 620 static PyObject *__pyx_m;
621 static PyObject *__pyx_d;
622 static PyObject *__pyx_b;
623 static PyObject *__pyx_empty_tuple;
624 static PyObject *__pyx_empty_bytes;
625 static PyObject *__pyx_empty_unicode;
626 static int __pyx_lineno;
627 static int __pyx_clineno = 0;
628 static const char * __pyx_cfilenm= __FILE__;
629 static const char *__pyx_filename;
632 #if !defined(CYTHON_CCOMPLEX) 633 #if defined(__cplusplus) 634 #define CYTHON_CCOMPLEX 1 635 #elif defined(_Complex_I) 636 #define CYTHON_CCOMPLEX 1 638 #define CYTHON_CCOMPLEX 0 648 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 650 #define _Complex_I 1.0fj 654 static const char *__pyx_f[] = {
655 "proteus/subsurfaceTransportFunctions.pyx",
656 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
657 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
660 #define IS_UNSIGNED(type) (((type) -1) > 0) 661 struct __Pyx_StructField_;
662 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0) 665 struct __Pyx_StructField_* fields;
673 typedef struct __Pyx_StructField_ {
674 __Pyx_TypeInfo* type;
679 __Pyx_StructField* field;
680 size_t parent_offset;
681 } __Pyx_BufFmt_StackElem;
683 __Pyx_StructField root;
684 __Pyx_BufFmt_StackElem* head;
686 size_t new_count, enc_count;
687 size_t struct_alignment;
693 } __Pyx_BufFmt_Context;
703 typedef npy_int8 __pyx_t_5numpy_int8_t;
712 typedef npy_int16 __pyx_t_5numpy_int16_t;
721 typedef npy_int32 __pyx_t_5numpy_int32_t;
730 typedef npy_int64 __pyx_t_5numpy_int64_t;
739 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
748 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
757 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
766 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
775 typedef npy_float32 __pyx_t_5numpy_float32_t;
784 typedef npy_float64 __pyx_t_5numpy_float64_t;
793 typedef npy_long __pyx_t_5numpy_int_t;
802 typedef npy_longlong __pyx_t_5numpy_long_t;
811 typedef npy_longlong __pyx_t_5numpy_longlong_t;
820 typedef npy_ulong __pyx_t_5numpy_uint_t;
829 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
838 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
847 typedef npy_intp __pyx_t_5numpy_intp_t;
856 typedef npy_uintp __pyx_t_5numpy_uintp_t;
865 typedef npy_double __pyx_t_5numpy_float_t;
874 typedef npy_double __pyx_t_5numpy_double_t;
883 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
892 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
901 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
905 typedef ::std::complex< float > __pyx_t_float_complex;
907 typedef float _Complex __pyx_t_float_complex;
910 typedef struct {
float real, imag; } __pyx_t_float_complex;
912 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
917 typedef ::std::complex< double > __pyx_t_double_complex;
919 typedef double _Complex __pyx_t_double_complex;
922 typedef struct {
double real, imag; } __pyx_t_double_complex;
924 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
936 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
945 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
954 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
963 typedef npy_cdouble __pyx_t_5numpy_complex_t;
967 #ifndef CYTHON_REFNANNY 968 #define CYTHON_REFNANNY 0 972 void (*INCREF)(
void*, PyObject*, int);
973 void (*DECREF)(
void*, PyObject*, int);
974 void (*GOTREF)(
void*, PyObject*, int);
975 void (*GIVEREF)(
void*, PyObject*, int);
976 void* (*SetupContext)(
const char*, int,
const char*);
977 void (*FinishContext)(
void**);
978 } __Pyx_RefNannyAPIStruct;
979 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
980 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
981 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 983 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 985 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 986 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 987 PyGILState_Release(__pyx_gilstate_save);\ 989 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 992 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 993 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 995 #define __Pyx_RefNannyFinishContext()\ 996 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 997 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 998 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 999 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1000 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 1001 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 1002 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 1003 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 1004 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 1006 #define __Pyx_RefNannyDeclarations 1007 #define __Pyx_RefNannySetupContext(name, acquire_gil) 1008 #define __Pyx_RefNannyFinishContext() 1009 #define __Pyx_INCREF(r) Py_INCREF(r) 1010 #define __Pyx_DECREF(r) Py_DECREF(r) 1011 #define __Pyx_GOTREF(r) 1012 #define __Pyx_GIVEREF(r) 1013 #define __Pyx_XINCREF(r) Py_XINCREF(r) 1014 #define __Pyx_XDECREF(r) Py_XDECREF(r) 1015 #define __Pyx_XGOTREF(r) 1016 #define __Pyx_XGIVEREF(r) 1018 #define __Pyx_XDECREF_SET(r, v) do {\ 1019 PyObject *tmp = (PyObject *) r;\ 1020 r = v; __Pyx_XDECREF(tmp);\ 1022 #define __Pyx_DECREF_SET(r, v) do {\ 1023 PyObject *tmp = (PyObject *) r;\ 1024 r = v; __Pyx_DECREF(tmp);\ 1026 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 1027 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 1030 #if CYTHON_USE_TYPE_SLOTS 1031 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1032 PyTypeObject* tp = Py_TYPE(obj);
1033 if (likely(tp->tp_getattro))
1034 return tp->tp_getattro(obj, attr_name);
1035 #if PY_MAJOR_VERSION < 3 1036 if (likely(tp->tp_getattr))
1037 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1039 return PyObject_GetAttr(obj, attr_name);
1042 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 1046 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1049 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1050 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1053 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1056 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1057 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1058 const char* function_name);
1061 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
1062 const char *name,
int exact);
1065 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1066 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
1067 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1068 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1069 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1070 __Pyx_BufFmt_StackElem* stack,
1071 __Pyx_TypeInfo* type);
1074 static void __Pyx_RaiseBufferIndexError(
int axis);
1076 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0) 1077 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1) 1079 #if CYTHON_FAST_THREAD_STATE 1080 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 1081 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); 1083 #define __Pyx_PyThreadState_declare 1084 #define __Pyx_PyThreadState_assign 1088 #if CYTHON_FAST_THREAD_STATE 1089 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 1090 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 1091 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 1092 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 1093 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1094 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1096 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 1097 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 1098 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 1099 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 1103 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY 1104 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
1106 value = PyDict_GetItemWithError(d, key);
1107 if (unlikely(!value)) {
1108 if (!PyErr_Occurred()) {
1109 PyObject* args = PyTuple_Pack(1, key);
1111 PyErr_SetObject(PyExc_KeyError, args);
1120 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) 1123 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2) 1125 #if !CYTHON_COMPILING_IN_PYPY 1126 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
1128 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace)\ 1129 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) 1132 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3) 1134 #if CYTHON_FAST_PYCALL 1135 #define __Pyx_PyFunction_FastCall(func, args, nargs)\ 1136 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) 1137 #if 1 || PY_VERSION_HEX < 0x030600B1 1138 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1140 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) 1145 #if CYTHON_FAST_PYCCALL 1146 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1148 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) 1152 #if CYTHON_COMPILING_IN_CPYTHON 1153 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1155 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 1159 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1162 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1165 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1166 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1167 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ 1168 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ 1169 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) 1170 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1171 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1172 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1173 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) 1174 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1175 int wraparound,
int boundscheck);
1176 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ 1177 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ 1178 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ 1179 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) 1180 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1181 int wraparound,
int boundscheck);
1182 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1183 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1184 int is_list,
int wraparound,
int boundscheck);
1187 #if CYTHON_COMPILING_IN_CPYTHON 1188 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1192 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1195 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1196 #if CYTHON_COMPILING_IN_PYPY 1197 #define __Pyx_PyObject_AsDouble(obj)\ 1198 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\ 1199 likely(PyInt_CheckExact(obj)) ?\ 1200 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) 1202 #define __Pyx_PyObject_AsDouble(obj)\ 1203 ((likely(PyFloat_CheckExact(obj))) ?\ 1204 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) 1208 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1211 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1214 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1217 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1220 #if CYTHON_FAST_THREAD_STATE 1221 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) 1222 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1223 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) 1224 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1226 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) 1227 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) 1231 #if CYTHON_FAST_THREAD_STATE 1232 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) 1233 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1235 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) 1239 #if CYTHON_FAST_THREAD_STATE 1240 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) 1241 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1243 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1247 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1251 PyCodeObject* code_object;
1253 } __Pyx_CodeObjectCacheEntry;
1254 struct __Pyx_CodeObjectCache {
1257 __Pyx_CodeObjectCacheEntry* entries;
1259 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1260 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1261 static PyCodeObject *__pyx_find_code_object(
int code_line);
1262 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1265 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1266 int py_line,
const char *filename);
1270 Py_ssize_t shape, strides, suboffsets;
1271 } __Pyx_Buf_DimInfo;
1277 __Pyx_Buffer *rcbuffer;
1279 __Pyx_Buf_DimInfo diminfo[8];
1280 } __Pyx_LocalBuf_ND;
1282 #if PY_MAJOR_VERSION < 3 1283 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1284 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1286 #define __Pyx_GetBuffer PyObject_GetBuffer 1287 #define __Pyx_ReleaseBuffer PyBuffer_Release 1292 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
1293 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
1296 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1299 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1302 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1307 #define __Pyx_CREAL(z) ((z).real()) 1308 #define __Pyx_CIMAG(z) ((z).imag()) 1310 #define __Pyx_CREAL(z) (__real__(z)) 1311 #define __Pyx_CIMAG(z) (__imag__(z)) 1314 #define __Pyx_CREAL(z) ((z).real) 1315 #define __Pyx_CIMAG(z) ((z).imag) 1317 #if defined(__cplusplus) && CYTHON_CCOMPLEX\ 1318 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) 1319 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) 1320 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) 1322 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 1323 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 1328 #define __Pyx_c_eq_float(a, b) ((a)==(b)) 1329 #define __Pyx_c_sum_float(a, b) ((a)+(b)) 1330 #define __Pyx_c_diff_float(a, b) ((a)-(b)) 1331 #define __Pyx_c_prod_float(a, b) ((a)*(b)) 1332 #define __Pyx_c_quot_float(a, b) ((a)/(b)) 1333 #define __Pyx_c_neg_float(a) (-(a)) 1335 #define __Pyx_c_is_zero_float(z) ((z)==(float)0) 1336 #define __Pyx_c_conj_float(z) (::std::conj(z)) 1338 #define __Pyx_c_abs_float(z) (::std::abs(z)) 1339 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b)) 1342 #define __Pyx_c_is_zero_float(z) ((z)==0) 1343 #define __Pyx_c_conj_float(z) (conjf(z)) 1345 #define __Pyx_c_abs_float(z) (cabsf(z)) 1346 #define __Pyx_c_pow_float(a, b) (cpowf(a, b)) 1350 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1351 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1352 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1353 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1354 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1355 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1356 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1357 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1359 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
1360 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
1366 #define __Pyx_c_eq_double(a, b) ((a)==(b)) 1367 #define __Pyx_c_sum_double(a, b) ((a)+(b)) 1368 #define __Pyx_c_diff_double(a, b) ((a)-(b)) 1369 #define __Pyx_c_prod_double(a, b) ((a)*(b)) 1370 #define __Pyx_c_quot_double(a, b) ((a)/(b)) 1371 #define __Pyx_c_neg_double(a) (-(a)) 1373 #define __Pyx_c_is_zero_double(z) ((z)==(double)0) 1374 #define __Pyx_c_conj_double(z) (::std::conj(z)) 1376 #define __Pyx_c_abs_double(z) (::std::abs(z)) 1377 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b)) 1380 #define __Pyx_c_is_zero_double(z) ((z)==0) 1381 #define __Pyx_c_conj_double(z) (conj(z)) 1383 #define __Pyx_c_abs_double(z) (cabs(z)) 1384 #define __Pyx_c_pow_double(a, b) (cpow(a, b)) 1388 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
1389 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
1390 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
1391 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
1392 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
1393 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
1394 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
1395 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
1397 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
1398 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
1403 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1406 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1409 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1412 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1415 static int __Pyx_check_binary_version(
void);
1418 #if !defined(__Pyx_PyIdentifier_FromString) 1419 #if PY_MAJOR_VERSION < 3 1420 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) 1422 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) 1427 static PyObject *__Pyx_ImportModule(
const char *name);
1430 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
1433 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1445 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1458 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1459 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1460 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1461 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1462 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1463 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1466 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1467 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1468 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions" 1469 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1472 static PyObject *__pyx_builtin_range;
1473 static PyObject *__pyx_builtin_ValueError;
1474 static PyObject *__pyx_builtin_RuntimeError;
1475 static PyObject *__pyx_builtin_ImportError;
1476 static const char __pyx_k_I[] =
"I";
1477 static const char __pyx_k_J[] =
"J";
1478 static const char __pyx_k_d[] =
"d";
1479 static const char __pyx_k_i[] =
"i";
1480 static const char __pyx_k_j[] =
"j";
1481 static const char __pyx_k_k[] =
"k";
1482 static const char __pyx_k_m[] =
"m";
1483 static const char __pyx_k_n[] =
"n";
1484 static const char __pyx_k_q[] =
"q";
1485 static const char __pyx_k_t[] =
"t";
1486 static const char __pyx_k_v[] =
"v";
1487 static const char __pyx_k_w[] =
"w";
1488 static const char __pyx_k_x[] =
"x";
1489 static const char __pyx_k_dS[] =
"dS";
1490 static const char __pyx_k_dV[] =
"dV";
1491 static const char __pyx_k_df[] =
"df";
1492 static const char __pyx_k_dm[] =
"dm";
1493 static const char __pyx_k_eN[] =
"eN";
1494 static const char __pyx_k_ii[] =
"ii";
1495 static const char __pyx_k_kb[] =
"kb";
1496 static const char __pyx_k_mt[] =
"mt";
1497 static const char __pyx_k_nd[] =
"nd";
1498 static const char __pyx_k_pi[] =
"pi";
1499 static const char __pyx_k_xc[] =
"xc";
1500 static const char __pyx_k_yc[] =
"yc";
1501 static const char __pyx_k_KWr[] =
"KWr";
1502 static const char __pyx_k_KWs[] =
"KWs";
1503 static const char __pyx_k_dmt[] =
"dmt";
1504 static const char __pyx_k_dot[] =
"dot";
1505 static const char __pyx_k_ebN[] =
"ebN";
1506 static const char __pyx_k_l2g[] =
"l2g";
1507 static const char __pyx_k_nnz[] =
"nnz";
1508 static const char __pyx_k_q_m[] =
"q_m";
1509 static const char __pyx_k_q_r[] =
"q_r";
1510 static const char __pyx_k_q_u[] =
"q_u";
1511 static const char __pyx_k_q_x[] =
"q_x";
1512 static const char __pyx_k_rho[] =
"rho";
1513 static const char __pyx_k_sum[] =
"sum";
1514 static const char __pyx_k_u_j[] =
"u_j";
1515 static const char __pyx_k_vol[] =
"vol";
1516 static const char __pyx_k_a_eN[] =
"a_eN";
1517 static const char __pyx_k_a_up[] =
"a_up";
1518 static const char __pyx_k_beta[] =
"beta";
1519 static const char __pyx_k_ebNE[] =
"ebNE";
1520 static const char __pyx_k_f_up[] =
"f_up";
1521 static const char __pyx_k_flat[] =
"flat";
1522 static const char __pyx_k_flux[] =
"flux";
1523 static const char __pyx_k_main[] =
"__main__";
1524 static const char __pyx_k_one8[] =
"one8";
1525 static const char __pyx_k_psiC[] =
"psiC";
1526 static const char __pyx_k_q_dm[] =
"q_dm";
1527 static const char __pyx_k_q_kr[] =
"q_kr";
1528 static const char __pyx_k_q_mt[] =
"q_mt";
1529 static const char __pyx_k_rho2[] =
"rho2";
1530 static const char __pyx_k_rhom[] =
"rhom";
1531 static const char __pyx_k_sBar[] =
"sBar";
1532 static const char __pyx_k_test[] =
"__test__";
1533 static const char __pyx_k_u_eN[] =
"u_eN";
1534 static const char __pyx_k_vBar[] =
"vBar";
1535 static const char __pyx_k_a_avg[] =
"a_avg";
1536 static const char __pyx_k_alpha[] =
"alpha";
1537 static const char __pyx_k_clock[] =
"clock";
1538 static const char __pyx_k_denom[] =
"denom";
1539 static const char __pyx_k_drhom[] =
"drhom";
1540 static const char __pyx_k_kr_eN[] =
"kr_eN";
1541 static const char __pyx_k_matID[] =
"matID";
1542 static const char __pyx_k_numer[] =
"numer";
1543 static const char __pyx_k_numpy[] =
"numpy";
1544 static const char __pyx_k_pcBar[] =
"pcBar";
1545 static const char __pyx_k_q_dkr[] =
"q_dkr";
1546 static const char __pyx_k_q_dmt[] =
"q_dmt";
1547 static const char __pyx_k_range[] =
"range";
1548 static const char __pyx_k_shape[] =
"shape";
1549 static const char __pyx_k_u_dof[] =
"u_dof";
1550 static const char __pyx_k_u_l2g[] =
"u_l2g";
1551 static const char __pyx_k_vBar2[] =
"vBar2";
1552 static const char __pyx_k_vol_e[] =
"vol_e";
1553 static const char __pyx_k_zeros[] =
"zeros";
1554 static const char __pyx_k_a_neig[] =
"a_neig";
1555 static const char __pyx_k_colind[] =
"colind";
1556 static const char __pyx_k_dkr_up[] =
"dkr_up";
1557 static const char __pyx_k_import[] =
"__import__";
1558 static const char __pyx_k_mt_avg[] =
"mt_avg";
1559 static const char __pyx_k_nSpace[] =
"nSpace";
1560 static const char __pyx_k_phi_eN[] =
"phi_eN";
1561 static const char __pyx_k_picard[] =
"picard";
1562 static const char __pyx_k_q_alin[] =
"q_alin";
1563 static const char __pyx_k_q_detJ[] =
"q_detJ";
1564 static const char __pyx_k_q_flin[] =
"q_flin";
1565 static const char __pyx_k_q_mass[] =
"q_mass";
1566 static const char __pyx_k_q_vals[] =
"q_vals";
1567 static const char __pyx_k_rowptr[] =
"rowptr";
1568 static const char __pyx_k_thetaR[] =
"thetaR";
1569 static const char __pyx_k_thetaS[] =
"thetaS";
1570 static const char __pyx_k_thetaW[] =
"thetaW";
1571 static const char __pyx_k_u_neig[] =
"u_neig";
1572 static const char __pyx_k_volume[] =
"volume";
1573 static const char __pyx_k_weight[] =
"weight";
1574 static const char __pyx_k_df_dofs[] =
"df_dofs";
1575 static const char __pyx_k_eN_left[] =
"eN_left";
1576 static const char __pyx_k_gravity[] =
"gravity";
1577 static const char __pyx_k_kr_neig[] =
"kr_neig";
1578 static const char __pyx_k_nSpace2[] =
"nSpace2";
1579 static const char __pyx_k_omega_e[] =
"omega_e";
1580 static const char __pyx_k_pcBar_n[] =
"pcBar_n";
1581 static const char __pyx_k_q_dmass[] =
"q_dmass";
1582 static const char __pyx_k_q_kr_up[] =
"q_kr_up";
1583 static const char __pyx_k_thetaSR[] =
"thetaSR";
1584 static const char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1585 static const char __pyx_k_eN_right[] =
"eN_right";
1586 static const char __pyx_k_ebq_vals[] =
"ebq_vals";
1587 static const char __pyx_k_integral[] =
"integral";
1588 static const char __pyx_k_material[] =
"material";
1589 static const char __pyx_k_phi_neig[] =
"phi_neig";
1590 static const char __pyx_k_q_grad_u[] =
"q_grad_u";
1591 static const char __pyx_k_q_grad_v[] =
"q_grad_v";
1592 static const char __pyx_k_q_grad_w[] =
"q_grad_w";
1593 static const char __pyx_k_ebN_local[] =
"ebN_local";
1594 static const char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1595 static const char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1596 static const char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1597 static const char __pyx_k_transient[] =
"transient";
1598 static const char __pyx_k_volFactor[] =
"volFactor";
1599 static const char __pyx_k_zVelocity[] =
"zVelocity";
1600 static const char __pyx_k_zvelocity[] =
"zvelocity";
1601 static const char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1602 static const char __pyx_k_ValueError[] =
"ValueError";
1603 static const char __pyx_k_matID_neig[] =
"matID_neig";
1604 static const char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1605 static const char __pyx_k_upwindFlag[] =
"upwindFlag";
1606 static const char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1607 static const char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1608 static const char __pyx_k_ImportError[] =
"ImportError";
1609 static const char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1610 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
1611 static const char __pyx_k_tForReversal[] =
"tForReversal";
1612 static const char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1613 static const char __pyx_k_material_left[] =
"material_left";
1614 static const char __pyx_k_weak_residual[] =
"weak_residual";
1615 static const char __pyx_k_material_right[] =
"material_right";
1616 static const char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1617 static const char __pyx_k_elementJacobian[] =
"elementJacobian";
1618 static const char __pyx_k_elementResidual[] =
"elementResidual";
1619 static const char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1620 static const char __pyx_k_nElements_global[] =
"nElements_global";
1621 static const char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1622 static const char __pyx_k_material_functions[] =
"material_functions";
1623 static const char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1624 static const char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1625 static const char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1626 static const char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1627 static const char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1628 static const char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1629 static const char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1630 static const char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1631 static const char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1632 static const char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1633 static const char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1634 static const char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1635 static const char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1636 static const char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1637 static const char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1638 static const char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1639 static const char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1640 static const char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1641 static const char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1642 static const char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1643 static const char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1644 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1645 static const char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1646 static const char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1647 static const char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1648 static const char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1649 static const char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1650 static const char __pyx_k_home_cekees_proteus_proteus_sub[] =
"/home/cekees/proteus/proteus/subsurfaceTransportFunctions.pyx";
1651 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
1652 static const char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1653 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1654 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1655 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1656 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1657 static const char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1658 static const char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1659 static const char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1660 static const char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1661 static const char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1662 static const char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1663 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1664 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
1665 static const char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1666 static const char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1667 static const char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1668 static const char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1669 static const char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1670 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1671 static const char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1672 static const char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1673 static const char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1674 static const char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1675 static const char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1676 static const char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1677 static const char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1678 static const char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1679 static PyObject *__pyx_n_s_DKWr_DpsiC;
1680 static PyObject *__pyx_n_s_DsBar_DpsiC;
1681 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1682 static PyObject *__pyx_n_s_DvBar_DpsiC;
1683 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1684 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1685 static PyObject *__pyx_n_s_I;
1686 static PyObject *__pyx_n_s_ImportError;
1687 static PyObject *__pyx_n_s_J;
1688 static PyObject *__pyx_n_s_KWr;
1689 static PyObject *__pyx_n_s_KWs;
1690 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1691 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1692 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1693 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1694 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1695 static PyObject *__pyx_n_s_RuntimeError;
1696 static PyObject *__pyx_n_s_ValueError;
1697 static PyObject *__pyx_n_s_a_avg;
1698 static PyObject *__pyx_n_s_a_eN;
1699 static PyObject *__pyx_n_s_a_neig;
1700 static PyObject *__pyx_n_s_a_up;
1701 static PyObject *__pyx_n_s_alpha;
1702 static PyObject *__pyx_n_s_beta;
1703 static PyObject *__pyx_n_s_calculateNormalFlux;
1704 static PyObject *__pyx_n_s_characteristic_velocity;
1705 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1706 static PyObject *__pyx_n_s_clock;
1707 static PyObject *__pyx_n_s_colind;
1708 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1709 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1710 static PyObject *__pyx_n_s_d;
1711 static PyObject *__pyx_n_s_dS;
1712 static PyObject *__pyx_n_s_dV;
1713 static PyObject *__pyx_n_s_denom;
1714 static PyObject *__pyx_n_s_df;
1715 static PyObject *__pyx_n_s_df_dofs;
1716 static PyObject *__pyx_n_s_dkr_up;
1717 static PyObject *__pyx_n_s_dm;
1718 static PyObject *__pyx_n_s_dmt;
1719 static PyObject *__pyx_n_s_dmtj_avg;
1720 static PyObject *__pyx_n_s_dot;
1721 static PyObject *__pyx_n_s_drhom;
1722 static PyObject *__pyx_n_s_eN;
1723 static PyObject *__pyx_n_s_eN_left;
1724 static PyObject *__pyx_n_s_eN_neighbor;
1725 static PyObject *__pyx_n_s_eN_right;
1726 static PyObject *__pyx_n_s_ebN;
1727 static PyObject *__pyx_n_s_ebNE;
1728 static PyObject *__pyx_n_s_ebN_local;
1729 static PyObject *__pyx_n_s_ebq_global_vals;
1730 static PyObject *__pyx_n_s_ebq_vals;
1731 static PyObject *__pyx_n_s_elementBarycentersArray;
1732 static PyObject *__pyx_n_s_elementBoundariesArray;
1733 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
1734 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
1735 static PyObject *__pyx_n_s_elementBoundaryTypes;
1736 static PyObject *__pyx_n_s_elementJacobian;
1737 static PyObject *__pyx_n_s_elementMaterialTypes;
1738 static PyObject *__pyx_n_s_elementNeighborsArray;
1739 static PyObject *__pyx_n_s_elementResidual;
1740 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
1741 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
1742 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
1743 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
1744 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
1745 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
1746 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
1747 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
1748 static PyObject *__pyx_n_s_f_up;
1749 static PyObject *__pyx_n_s_flat;
1750 static PyObject *__pyx_n_s_flux;
1751 static PyObject *__pyx_n_s_gravity;
1752 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
1753 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
1754 static PyObject *__pyx_kp_s_home_cekees_proteus_proteus_sub;
1755 static PyObject *__pyx_n_s_i;
1756 static PyObject *__pyx_n_s_ii;
1757 static PyObject *__pyx_n_s_import;
1758 static PyObject *__pyx_n_s_integral;
1759 static PyObject *__pyx_n_s_j;
1760 static PyObject *__pyx_n_s_jacobian_weak_residual;
1761 static PyObject *__pyx_n_s_k;
1762 static PyObject *__pyx_n_s_kb;
1763 static PyObject *__pyx_n_s_kr_eN;
1764 static PyObject *__pyx_n_s_kr_neig;
1765 static PyObject *__pyx_n_s_l2g;
1766 static PyObject *__pyx_n_s_m;
1767 static PyObject *__pyx_n_s_main;
1768 static PyObject *__pyx_n_s_matID;
1769 static PyObject *__pyx_n_s_matID_neig;
1770 static PyObject *__pyx_n_s_material;
1771 static PyObject *__pyx_n_s_material_functions;
1772 static PyObject *__pyx_n_s_material_left;
1773 static PyObject *__pyx_n_s_material_right;
1774 static PyObject *__pyx_n_s_mt;
1775 static PyObject *__pyx_n_s_mt_avg;
1776 static PyObject *__pyx_n_s_n;
1777 static PyObject *__pyx_n_s_nAvgWeight;
1778 static PyObject *__pyx_n_s_nDOF_test_element;
1779 static PyObject *__pyx_n_s_nDOF_trial_element;
1780 static PyObject *__pyx_n_s_nElementBoundaries_element;
1781 static PyObject *__pyx_n_s_nElementBoundaries_global;
1782 static PyObject *__pyx_n_s_nElements_global;
1783 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
1784 static PyObject *__pyx_n_s_nSpace;
1785 static PyObject *__pyx_n_s_nSpace2;
1786 static PyObject *__pyx_n_s_nd;
1787 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1788 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1789 static PyObject *__pyx_n_s_nnz;
1790 static PyObject *__pyx_n_s_numer;
1791 static PyObject *__pyx_n_s_numpy;
1792 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
1793 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
1794 static PyObject *__pyx_n_s_omega_e;
1795 static PyObject *__pyx_n_s_one8;
1796 static PyObject *__pyx_n_s_onePlus_pcBar_n;
1797 static PyObject *__pyx_n_s_pcBar;
1798 static PyObject *__pyx_n_s_pcBar_n;
1799 static PyObject *__pyx_n_s_pcBar_nM1;
1800 static PyObject *__pyx_n_s_pcBar_nM2;
1801 static PyObject *__pyx_n_s_phi_eN;
1802 static PyObject *__pyx_n_s_phi_neig;
1803 static PyObject *__pyx_n_s_pi;
1804 static PyObject *__pyx_n_s_picard;
1805 static PyObject *__pyx_n_s_psiC;
1806 static PyObject *__pyx_n_s_q;
1807 static PyObject *__pyx_n_s_q_alin;
1808 static PyObject *__pyx_n_s_q_detJ;
1809 static PyObject *__pyx_n_s_q_dkr;
1810 static PyObject *__pyx_n_s_q_dm;
1811 static PyObject *__pyx_n_s_q_dmass;
1812 static PyObject *__pyx_n_s_q_dmt;
1813 static PyObject *__pyx_n_s_q_flin;
1814 static PyObject *__pyx_n_s_q_grad_u;
1815 static PyObject *__pyx_n_s_q_grad_v;
1816 static PyObject *__pyx_n_s_q_grad_w;
1817 static PyObject *__pyx_n_s_q_kr;
1818 static PyObject *__pyx_n_s_q_kr_up;
1819 static PyObject *__pyx_n_s_q_m;
1820 static PyObject *__pyx_n_s_q_mass;
1821 static PyObject *__pyx_n_s_q_mt;
1822 static PyObject *__pyx_n_s_q_r;
1823 static PyObject *__pyx_n_s_q_u;
1824 static PyObject *__pyx_n_s_q_vals;
1825 static PyObject *__pyx_n_s_q_x;
1826 static PyObject *__pyx_n_s_range;
1827 static PyObject *__pyx_n_s_rho;
1828 static PyObject *__pyx_n_s_rho2;
1829 static PyObject *__pyx_n_s_rhom;
1830 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
1831 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
1832 static PyObject *__pyx_n_s_rowptr;
1833 static PyObject *__pyx_n_s_sBar;
1834 static PyObject *__pyx_n_s_setElementBoundariesArray;
1835 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
1836 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
1837 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
1838 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
1839 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
1840 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
1841 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
1842 static PyObject *__pyx_n_s_shape;
1843 static PyObject *__pyx_n_s_sqrt_sBar;
1844 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
1845 static PyObject *__pyx_n_s_sum;
1846 static PyObject *__pyx_n_s_t;
1847 static PyObject *__pyx_n_s_tForReversal;
1848 static PyObject *__pyx_n_s_test;
1849 static PyObject *__pyx_n_s_thetaR;
1850 static PyObject *__pyx_n_s_thetaS;
1851 static PyObject *__pyx_n_s_thetaSR;
1852 static PyObject *__pyx_n_s_thetaW;
1853 static PyObject *__pyx_n_s_thisElementIsUpwind;
1854 static PyObject *__pyx_n_s_transient;
1855 static PyObject *__pyx_n_s_u_dof;
1856 static PyObject *__pyx_n_s_u_eN;
1857 static PyObject *__pyx_n_s_u_j;
1858 static PyObject *__pyx_n_s_u_l2g;
1859 static PyObject *__pyx_n_s_u_neig;
1860 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1861 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
1862 static PyObject *__pyx_n_s_updateMass_weakAvg;
1863 static PyObject *__pyx_n_s_upwindFlag;
1864 static PyObject *__pyx_n_s_v;
1865 static PyObject *__pyx_n_s_vBar;
1866 static PyObject *__pyx_n_s_vBar2;
1867 static PyObject *__pyx_n_s_vol;
1868 static PyObject *__pyx_n_s_volFactor;
1869 static PyObject *__pyx_n_s_vol_e;
1870 static PyObject *__pyx_n_s_volume;
1871 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
1872 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
1873 static PyObject *__pyx_n_s_w;
1874 static PyObject *__pyx_n_s_weak_residual;
1875 static PyObject *__pyx_n_s_weight;
1876 static PyObject *__pyx_n_s_x;
1877 static PyObject *__pyx_n_s_xc;
1878 static PyObject *__pyx_n_s_yc;
1879 static PyObject *__pyx_n_s_zVelocity;
1880 static PyObject *__pyx_n_s_zeros;
1881 static PyObject *__pyx_n_s_zvelocity;
1882 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
1883 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
1884 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1885 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1886 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1887 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1888 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1889 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1890 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1891 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1892 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1893 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1894 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1895 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1896 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
1897 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
1898 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
1899 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
1900 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
1901 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
1902 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
1903 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
1904 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
1905 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
1906 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
1907 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1908 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1909 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1910 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1911 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1912 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
1913 static PyObject *__pyx_float_0_0;
1914 static PyObject *__pyx_float_0_5;
1915 static PyObject *__pyx_float_2_0;
1916 static PyObject *__pyx_float_1_0eneg_20;
1917 static PyObject *__pyx_slice_;
1918 static PyObject *__pyx_slice__2;
1919 static PyObject *__pyx_slice__3;
1920 static PyObject *__pyx_slice__4;
1921 static PyObject *__pyx_slice__5;
1922 static PyObject *__pyx_slice__6;
1923 static PyObject *__pyx_slice__7;
1924 static PyObject *__pyx_slice__8;
1925 static PyObject *__pyx_tuple__9;
1926 static PyObject *__pyx_tuple__10;
1927 static PyObject *__pyx_tuple__11;
1928 static PyObject *__pyx_tuple__12;
1929 static PyObject *__pyx_tuple__13;
1930 static PyObject *__pyx_tuple__14;
1931 static PyObject *__pyx_tuple__15;
1932 static PyObject *__pyx_tuple__16;
1933 static PyObject *__pyx_tuple__17;
1934 static PyObject *__pyx_tuple__18;
1935 static PyObject *__pyx_tuple__20;
1936 static PyObject *__pyx_tuple__22;
1937 static PyObject *__pyx_tuple__24;
1938 static PyObject *__pyx_tuple__26;
1939 static PyObject *__pyx_tuple__28;
1940 static PyObject *__pyx_tuple__30;
1941 static PyObject *__pyx_tuple__32;
1942 static PyObject *__pyx_tuple__34;
1943 static PyObject *__pyx_tuple__36;
1944 static PyObject *__pyx_tuple__38;
1945 static PyObject *__pyx_tuple__40;
1946 static PyObject *__pyx_tuple__42;
1947 static PyObject *__pyx_tuple__44;
1948 static PyObject *__pyx_tuple__46;
1949 static PyObject *__pyx_tuple__48;
1950 static PyObject *__pyx_tuple__50;
1951 static PyObject *__pyx_tuple__52;
1952 static PyObject *__pyx_tuple__54;
1953 static PyObject *__pyx_tuple__56;
1954 static PyObject *__pyx_tuple__58;
1955 static PyObject *__pyx_tuple__60;
1956 static PyObject *__pyx_tuple__62;
1957 static PyObject *__pyx_tuple__64;
1958 static PyObject *__pyx_tuple__66;
1959 static PyObject *__pyx_tuple__68;
1960 static PyObject *__pyx_tuple__70;
1961 static PyObject *__pyx_tuple__72;
1962 static PyObject *__pyx_tuple__74;
1963 static PyObject *__pyx_codeobj__19;
1964 static PyObject *__pyx_codeobj__21;
1965 static PyObject *__pyx_codeobj__23;
1966 static PyObject *__pyx_codeobj__25;
1967 static PyObject *__pyx_codeobj__27;
1968 static PyObject *__pyx_codeobj__29;
1969 static PyObject *__pyx_codeobj__31;
1970 static PyObject *__pyx_codeobj__33;
1971 static PyObject *__pyx_codeobj__35;
1972 static PyObject *__pyx_codeobj__37;
1973 static PyObject *__pyx_codeobj__39;
1974 static PyObject *__pyx_codeobj__41;
1975 static PyObject *__pyx_codeobj__43;
1976 static PyObject *__pyx_codeobj__45;
1977 static PyObject *__pyx_codeobj__47;
1978 static PyObject *__pyx_codeobj__49;
1979 static PyObject *__pyx_codeobj__51;
1980 static PyObject *__pyx_codeobj__53;
1981 static PyObject *__pyx_codeobj__55;
1982 static PyObject *__pyx_codeobj__57;
1983 static PyObject *__pyx_codeobj__59;
1984 static PyObject *__pyx_codeobj__61;
1985 static PyObject *__pyx_codeobj__63;
1986 static PyObject *__pyx_codeobj__65;
1987 static PyObject *__pyx_codeobj__67;
1988 static PyObject *__pyx_codeobj__69;
1989 static PyObject *__pyx_codeobj__71;
1990 static PyObject *__pyx_codeobj__73;
1991 static PyObject *__pyx_codeobj__75;
2001 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
2003 __Pyx_RefNannyDeclarations
2005 __Pyx_RefNannySetupContext(
"double_max", 0);
2006 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
2007 __pyx_t_1 = __pyx_v_a;
2009 __pyx_t_1 = __pyx_v_b;
2011 __pyx_r = __pyx_t_1;
2016 __Pyx_RefNannyFinishContext();
2028 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
2030 __Pyx_RefNannyDeclarations
2032 __Pyx_RefNannySetupContext(
"double_min", 0);
2033 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
2034 __pyx_t_1 = __pyx_v_a;
2036 __pyx_t_1 = __pyx_v_b;
2038 __pyx_r = __pyx_t_1;
2043 __Pyx_RefNannyFinishContext();
2056 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2057 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
2058 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2059 int __pyx_v_nExteriorElementBoundaries_global;
2060 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
2061 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2062 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2063 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
2064 PyObject *__pyx_r = 0;
2065 __Pyx_RefNannyDeclarations
2066 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
2068 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
2069 PyObject* values[5] = {0,0,0,0,0};
2070 if (unlikely(__pyx_kwds)) {
2072 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2074 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2075 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2076 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2077 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2078 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2080 default:
goto __pyx_L5_argtuple_error;
2082 kw_args = PyDict_Size(__pyx_kwds);
2085 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
2086 else goto __pyx_L5_argtuple_error;
2088 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
2090 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); __PYX_ERR(0, 18, __pyx_L3_error)
2093 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2095 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); __PYX_ERR(0, 18, __pyx_L3_error)
2098 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2100 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); __PYX_ERR(0, 18, __pyx_L3_error)
2103 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
2105 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); __PYX_ERR(0, 18, __pyx_L3_error)
2108 if (unlikely(kw_args > 0)) {
2109 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
2111 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
2112 goto __pyx_L5_argtuple_error;
2114 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2115 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2116 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2117 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2118 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2120 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
2121 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
2122 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
2123 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
2124 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
2126 goto __pyx_L4_argument_unpacking_done;
2127 __pyx_L5_argtuple_error:;
2128 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 18, __pyx_L3_error)
2130 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2131 __Pyx_RefNannyFinishContext();
2133 __pyx_L4_argument_unpacking_done:;
2134 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) __PYX_ERR(0, 19, __pyx_L1_error)
2135 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 20, __pyx_L1_error)
2136 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 21, __pyx_L1_error)
2137 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2138 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
2145 __Pyx_RefNannyFinishContext();
2149 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
2153 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2154 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2155 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2156 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2157 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
2158 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
2159 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
2160 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2161 PyObject *__pyx_r = NULL;
2162 __Pyx_RefNannyDeclarations
2165 Py_ssize_t __pyx_t_3;
2167 Py_ssize_t __pyx_t_5;
2168 Py_ssize_t __pyx_t_6;
2169 Py_ssize_t __pyx_t_7;
2170 Py_ssize_t __pyx_t_8;
2171 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
2172 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
2173 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
2174 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
2175 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
2176 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2177 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2178 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2179 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2180 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2181 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2182 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2183 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2184 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
2185 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
2186 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
2187 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
2189 __Pyx_BufFmt_StackElem __pyx_stack[1];
2190 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2192 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
2194 __Pyx_BufFmt_StackElem __pyx_stack[1];
2195 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2197 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2199 __Pyx_BufFmt_StackElem __pyx_stack[1];
2200 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2202 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2204 __Pyx_BufFmt_StackElem __pyx_stack[1];
2205 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 18, __pyx_L1_error)
2207 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
2216 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
2217 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2218 __pyx_v_ebNE = __pyx_t_2;
2227 __pyx_t_3 = __pyx_v_ebNE;
2229 if (__pyx_t_3 < 0) {
2230 __pyx_t_3 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
2231 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
2232 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_4 = 0;
2233 if (unlikely(__pyx_t_4 != -1)) {
2234 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2235 __PYX_ERR(0, 25, __pyx_L1_error)
2237 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
2246 __pyx_t_5 = __pyx_v_ebN;
2249 if (__pyx_t_5 < 0) {
2250 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2251 if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0;
2252 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_4 = 0;
2253 if (__pyx_t_6 < 0) {
2254 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2255 if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 1;
2256 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_4 = 1;
2257 if (unlikely(__pyx_t_4 != -1)) {
2258 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2259 __PYX_ERR(0, 26, __pyx_L1_error)
2261 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2270 __pyx_t_7 = __pyx_v_eN;
2272 if (__pyx_t_7 < 0) {
2273 __pyx_t_7 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2274 if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
2275 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2276 if (unlikely(__pyx_t_4 != -1)) {
2277 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2278 __PYX_ERR(0, 27, __pyx_L1_error)
2280 __pyx_t_8 = __pyx_v_ebNE;
2282 if (__pyx_t_8 < 0) {
2283 __pyx_t_8 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
2284 if (unlikely(__pyx_t_8 < 0)) __pyx_t_4 = 0;
2285 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2286 if (unlikely(__pyx_t_4 != -1)) {
2287 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2288 __PYX_ERR(0, 27, __pyx_L1_error)
2290 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2302 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2305 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2306 __Pyx_PyThreadState_declare
2307 __Pyx_PyThreadState_assign
2308 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2309 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2310 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2311 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2312 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2313 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2314 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2318 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2319 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2320 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2321 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2323 __Pyx_XGIVEREF(__pyx_r);
2324 __Pyx_RefNannyFinishContext();
2337 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2338 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2339 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2340 int __pyx_v_nElementBoundaries_global;
2341 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2342 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2343 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2344 PyObject *__pyx_r = 0;
2345 __Pyx_RefNannyDeclarations
2346 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2348 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2349 PyObject* values[4] = {0,0,0,0};
2350 if (unlikely(__pyx_kwds)) {
2352 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2354 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2355 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2356 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2357 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2359 default:
goto __pyx_L5_argtuple_error;
2361 kw_args = PyDict_Size(__pyx_kwds);
2364 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2365 else goto __pyx_L5_argtuple_error;
2367 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2369 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
2372 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2374 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
2377 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2379 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
2382 if (unlikely(kw_args > 0)) {
2383 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) __PYX_ERR(0, 29, __pyx_L3_error)
2385 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2386 goto __pyx_L5_argtuple_error;
2388 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2389 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2390 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2391 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2393 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
2394 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2395 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2396 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2398 goto __pyx_L4_argument_unpacking_done;
2399 __pyx_L5_argtuple_error:;
2400 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 29, __pyx_L3_error)
2402 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2403 __Pyx_RefNannyFinishContext();
2405 __pyx_L4_argument_unpacking_done:;
2406 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) __PYX_ERR(0, 30, __pyx_L1_error)
2407 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 31, __pyx_L1_error)
2408 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) __PYX_ERR(0, 32, __pyx_L1_error)
2409 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2416 __Pyx_RefNannyFinishContext();
2420 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2422 int __pyx_v_eN_left;
2423 int __pyx_v_eN_right;
2424 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2425 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2426 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2427 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2428 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2429 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2430 PyObject *__pyx_r = NULL;
2431 __Pyx_RefNannyDeclarations
2434 Py_ssize_t __pyx_t_3;
2435 Py_ssize_t __pyx_t_4;
2437 Py_ssize_t __pyx_t_6;
2438 Py_ssize_t __pyx_t_7;
2439 Py_ssize_t __pyx_t_8;
2440 Py_ssize_t __pyx_t_9;
2441 Py_ssize_t __pyx_t_10;
2442 Py_ssize_t __pyx_t_11;
2443 Py_ssize_t __pyx_t_12;
2444 Py_ssize_t __pyx_t_13;
2446 Py_ssize_t __pyx_t_15;
2447 Py_ssize_t __pyx_t_16;
2448 Py_ssize_t __pyx_t_17;
2449 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2450 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2451 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2452 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2453 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2454 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2455 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2456 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2457 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2458 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2459 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2460 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2461 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2463 __Pyx_BufFmt_StackElem __pyx_stack[1];
2464 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2466 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2468 __Pyx_BufFmt_StackElem __pyx_stack[1];
2469 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2471 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2473 __Pyx_BufFmt_StackElem __pyx_stack[1];
2474 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 29, __pyx_L1_error)
2476 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2485 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2486 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2487 __pyx_v_ebN = __pyx_t_2;
2496 __pyx_t_3 = __pyx_v_ebN;
2499 if (__pyx_t_3 < 0) {
2500 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2501 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
2502 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2503 if (__pyx_t_4 < 0) {
2504 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2505 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
2506 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2507 if (unlikely(__pyx_t_5 != -1)) {
2508 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2509 __PYX_ERR(0, 35, __pyx_L1_error)
2511 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2520 __pyx_t_6 = __pyx_v_ebN;
2523 if (__pyx_t_6 < 0) {
2524 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2525 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2526 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2527 if (__pyx_t_7 < 0) {
2528 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2529 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
2530 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2531 if (unlikely(__pyx_t_5 != -1)) {
2532 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2533 __PYX_ERR(0, 36, __pyx_L1_error)
2535 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2544 __pyx_t_8 = __pyx_v_eN_left;
2546 if (__pyx_t_8 < 0) {
2547 __pyx_t_8 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2548 if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
2549 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2550 if (unlikely(__pyx_t_5 != -1)) {
2551 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2552 __PYX_ERR(0, 37, __pyx_L1_error)
2554 __pyx_t_9 = __pyx_v_ebN;
2557 if (__pyx_t_9 < 0) {
2558 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2559 if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
2560 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2561 if (__pyx_t_10 < 0) {
2562 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2563 if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 1;
2564 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2565 if (unlikely(__pyx_t_5 != -1)) {
2566 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2567 __PYX_ERR(0, 37, __pyx_L1_error)
2569 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2578 __pyx_t_11 = __pyx_v_eN_left;
2580 if (__pyx_t_11 < 0) {
2581 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2582 if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
2583 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2584 if (unlikely(__pyx_t_5 != -1)) {
2585 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2586 __PYX_ERR(0, 38, __pyx_L1_error)
2588 __pyx_t_12 = __pyx_v_ebN;
2591 if (__pyx_t_12 < 0) {
2592 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2593 if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0;
2594 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2595 if (__pyx_t_13 < 0) {
2596 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2597 if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 1;
2598 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2599 if (unlikely(__pyx_t_5 != -1)) {
2600 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2601 __PYX_ERR(0, 38, __pyx_L1_error)
2603 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2612 __pyx_t_14 = ((__pyx_v_eN_right >= 0) != 0);
2622 __pyx_t_15 = __pyx_v_eN_right;
2624 if (__pyx_t_15 < 0) {
2625 __pyx_t_15 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2626 if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
2627 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2628 if (unlikely(__pyx_t_5 != -1)) {
2629 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2630 __PYX_ERR(0, 40, __pyx_L1_error)
2632 __pyx_t_16 = __pyx_v_ebN;
2635 if (__pyx_t_16 < 0) {
2636 __pyx_t_16 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2637 if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0;
2638 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2639 if (__pyx_t_17 < 0) {
2640 __pyx_t_17 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2641 if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 1;
2642 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2643 if (unlikely(__pyx_t_5 != -1)) {
2644 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2645 __PYX_ERR(0, 40, __pyx_L1_error)
2647 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2668 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2671 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2672 __Pyx_PyThreadState_declare
2673 __Pyx_PyThreadState_assign
2674 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2675 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2676 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2677 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2678 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2679 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2683 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2684 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2685 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2687 __Pyx_XGIVEREF(__pyx_r);
2688 __Pyx_RefNannyFinishContext();
2701 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2702 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2703 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2704 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2705 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2706 PyArrayObject *__pyx_v_q_vals = 0;
2707 PyObject *__pyx_v_material_functions = 0;
2708 PyObject *__pyx_r = 0;
2709 __Pyx_RefNannyDeclarations
2710 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
2712 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2713 PyObject* values[3] = {0,0,0};
2714 if (unlikely(__pyx_kwds)) {
2716 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2718 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2719 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2720 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2722 default:
goto __pyx_L5_argtuple_error;
2724 kw_args = PyDict_Size(__pyx_kwds);
2727 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2728 else goto __pyx_L5_argtuple_error;
2730 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
2732 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 43, __pyx_L3_error)
2735 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2737 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 43, __pyx_L3_error)
2740 if (unlikely(kw_args > 0)) {
2741 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 43, __pyx_L3_error)
2743 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2744 goto __pyx_L5_argtuple_error;
2746 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2747 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2748 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2750 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
2751 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
2752 __pyx_v_material_functions = ((PyObject*)values[2]);
2754 goto __pyx_L4_argument_unpacking_done;
2755 __pyx_L5_argtuple_error:;
2756 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 43, __pyx_L3_error)
2758 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2759 __Pyx_RefNannyFinishContext();
2761 __pyx_L4_argument_unpacking_done:;
2762 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 43, __pyx_L1_error)
2763 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 44, __pyx_L1_error)
2764 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 45, __pyx_L1_error)
2765 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
2772 __Pyx_RefNannyFinishContext();
2776 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
2779 int __pyx_v_material;
2780 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2781 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2782 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
2783 __Pyx_Buffer __pyx_pybuffer_q_vals;
2784 PyObject *__pyx_r = NULL;
2785 __Pyx_RefNannyDeclarations
2788 Py_ssize_t __pyx_t_3;
2791 PyObject *__pyx_t_6 = NULL;
2792 PyObject *__pyx_t_7 = NULL;
2793 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_8;
2794 Py_ssize_t __pyx_t_9;
2795 Py_ssize_t __pyx_t_10;
2797 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
2798 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2799 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2800 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2801 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2802 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
2803 __pyx_pybuffer_q_vals.refcount = 0;
2804 __pyx_pybuffernd_q_vals.data = NULL;
2805 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
2807 __Pyx_BufFmt_StackElem __pyx_stack[1];
2808 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
2810 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2812 __Pyx_BufFmt_StackElem __pyx_stack[1];
2813 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
2815 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
2824 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
2825 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2826 __pyx_v_eN = __pyx_t_2;
2835 __pyx_t_3 = __pyx_v_eN;
2837 if (__pyx_t_3 < 0) {
2838 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2839 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
2840 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2841 if (unlikely(__pyx_t_4 != -1)) {
2842 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2843 __PYX_ERR(0, 52, __pyx_L1_error)
2845 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2854 __pyx_t_5 = (__pyx_v_q_vals->dimensions[1]);
2855 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
2856 __pyx_v_k = __pyx_t_4;
2865 if (unlikely(__pyx_v_material_functions == Py_None)) {
2866 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
2867 __PYX_ERR(0, 54, __pyx_L1_error)
2869 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error)
2870 __Pyx_GOTREF(__pyx_t_6);
2871 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 54, __pyx_L1_error)
2872 __Pyx_GOTREF(__pyx_t_7);
2873 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2874 __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7);
if (unlikely((__pyx_t_8 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
2875 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2876 __pyx_t_9 = __pyx_v_eN;
2877 __pyx_t_10 = __pyx_v_k;
2879 if (__pyx_t_9 < 0) {
2880 __pyx_t_9 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
2881 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 0;
2882 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_11 = 0;
2883 if (__pyx_t_10 < 0) {
2884 __pyx_t_10 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
2885 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 1;
2886 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_11 = 1;
2887 if (unlikely(__pyx_t_11 != -1)) {
2888 __Pyx_RaiseBufferIndexError(__pyx_t_11);
2889 __PYX_ERR(0, 54, __pyx_L1_error)
2891 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_8;
2904 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2907 __Pyx_XDECREF(__pyx_t_6);
2908 __Pyx_XDECREF(__pyx_t_7);
2909 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2910 __Pyx_PyThreadState_declare
2911 __Pyx_PyThreadState_assign
2912 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2913 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2914 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2915 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2916 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2920 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2921 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2923 __Pyx_XGIVEREF(__pyx_r);
2924 __Pyx_RefNannyFinishContext();
2937 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2938 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
2939 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
2940 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2941 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2942 PyArrayObject *__pyx_v_q_vals = 0;
2943 PyObject *__pyx_v_material_functions = 0;
2944 PyObject *__pyx_r = 0;
2945 __Pyx_RefNannyDeclarations
2946 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
2948 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2949 PyObject* values[3] = {0,0,0};
2950 if (unlikely(__pyx_kwds)) {
2952 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2954 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2955 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2956 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2958 default:
goto __pyx_L5_argtuple_error;
2960 kw_args = PyDict_Size(__pyx_kwds);
2963 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2964 else goto __pyx_L5_argtuple_error;
2966 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
2968 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); __PYX_ERR(0, 56, __pyx_L3_error)
2971 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2973 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); __PYX_ERR(0, 56, __pyx_L3_error)
2976 if (unlikely(kw_args > 0)) {
2977 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 56, __pyx_L3_error)
2979 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2980 goto __pyx_L5_argtuple_error;
2982 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2983 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2984 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2986 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
2987 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
2988 __pyx_v_material_functions = ((PyObject*)values[2]);
2990 goto __pyx_L4_argument_unpacking_done;
2991 __pyx_L5_argtuple_error:;
2992 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 56, __pyx_L3_error)
2994 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2995 __Pyx_RefNannyFinishContext();
2997 __pyx_L4_argument_unpacking_done:;
2998 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 56, __pyx_L1_error)
2999 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 57, __pyx_L1_error)
3000 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 58, __pyx_L1_error)
3001 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
3008 __Pyx_RefNannyFinishContext();
3012 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
3015 int __pyx_v_material;
3016 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
3017 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
3018 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
3019 __Pyx_Buffer __pyx_pybuffer_q_vals;
3020 PyObject *__pyx_r = NULL;
3021 __Pyx_RefNannyDeclarations
3024 Py_ssize_t __pyx_t_3;
3027 PyObject *__pyx_t_6 = NULL;
3028 PyObject *__pyx_t_7 = NULL;
3029 PyObject *__pyx_t_8 = NULL;
3030 PyObject *__pyx_t_9 = NULL;
3031 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
3032 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
3033 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
3034 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
3035 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
3036 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
3037 __pyx_pybuffer_q_vals.refcount = 0;
3038 __pyx_pybuffernd_q_vals.data = NULL;
3039 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
3041 __Pyx_BufFmt_StackElem __pyx_stack[1];
3042 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3044 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
3046 __Pyx_BufFmt_StackElem __pyx_stack[1];
3047 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 56, __pyx_L1_error)
3049 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
3058 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
3059 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3060 __pyx_v_eN = __pyx_t_2;
3069 __pyx_t_3 = __pyx_v_eN;
3071 if (__pyx_t_3 < 0) {
3072 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
3073 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
3074 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
3075 if (unlikely(__pyx_t_4 != -1)) {
3076 __Pyx_RaiseBufferIndexError(__pyx_t_4);
3077 __PYX_ERR(0, 64, __pyx_L1_error)
3079 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
3088 __pyx_t_5 = (__pyx_v_q_vals->dimensions[1]);
3089 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
3090 __pyx_v_k = __pyx_t_4;
3099 if (unlikely(__pyx_v_material_functions == Py_None)) {
3100 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3101 __PYX_ERR(0, 66, __pyx_L1_error)
3103 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error)
3104 __Pyx_GOTREF(__pyx_t_6);
3105 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_6);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
3106 __Pyx_GOTREF(__pyx_t_7);
3107 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3108 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flat);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error)
3109 __Pyx_GOTREF(__pyx_t_6);
3110 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3111 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
3112 __Pyx_GOTREF(__pyx_t_7);
3113 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 66, __pyx_L1_error)
3114 __Pyx_GOTREF(__pyx_t_8);
3115 __pyx_t_9 = PyTuple_New(3);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
3116 __Pyx_GOTREF(__pyx_t_9);
3117 __Pyx_GIVEREF(__pyx_t_7);
3118 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
3119 __Pyx_GIVEREF(__pyx_t_8);
3120 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
3121 __Pyx_INCREF(__pyx_slice_);
3122 __Pyx_GIVEREF(__pyx_slice_);
3123 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_slice_);
3126 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_9, __pyx_t_6) < 0)) __PYX_ERR(0, 66, __pyx_L1_error)
3127 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
3128 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3141 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3144 __Pyx_XDECREF(__pyx_t_6);
3145 __Pyx_XDECREF(__pyx_t_7);
3146 __Pyx_XDECREF(__pyx_t_8);
3147 __Pyx_XDECREF(__pyx_t_9);
3148 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3149 __Pyx_PyThreadState_declare
3150 __Pyx_PyThreadState_assign
3151 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3152 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3153 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3154 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3155 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
3159 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
3160 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
3162 __Pyx_XGIVEREF(__pyx_r);
3163 __Pyx_RefNannyFinishContext();
3176 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3177 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3178 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
3179 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3180 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3181 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3182 PyArrayObject *__pyx_v_ebq_vals = 0;
3183 PyObject *__pyx_v_material_functions = 0;
3184 PyObject *__pyx_r = 0;
3185 __Pyx_RefNannyDeclarations
3186 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
3188 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3189 PyObject* values[4] = {0,0,0,0};
3190 if (unlikely(__pyx_kwds)) {
3192 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3194 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3195 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3196 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3197 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3199 default:
goto __pyx_L5_argtuple_error;
3201 kw_args = PyDict_Size(__pyx_kwds);
3204 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3205 else goto __pyx_L5_argtuple_error;
3207 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3209 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
3212 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3214 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
3217 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3219 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 69, __pyx_L3_error)
3222 if (unlikely(kw_args > 0)) {
3223 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
3225 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3226 goto __pyx_L5_argtuple_error;
3228 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3229 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3230 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3231 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3233 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3234 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3235 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
3236 __pyx_v_material_functions = ((PyObject*)values[3]);
3238 goto __pyx_L4_argument_unpacking_done;
3239 __pyx_L5_argtuple_error:;
3240 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
3242 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3243 __Pyx_RefNannyFinishContext();
3245 __pyx_L4_argument_unpacking_done:;
3246 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 69, __pyx_L1_error)
3247 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 70, __pyx_L1_error)
3248 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 71, __pyx_L1_error)
3249 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 72, __pyx_L1_error)
3250 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3257 __Pyx_RefNannyFinishContext();
3261 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3264 int __pyx_v_ebN_local;
3266 int __pyx_v_material_left;
3267 int __pyx_v_material_right;
3268 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3269 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3270 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3271 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3272 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3273 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3274 PyObject *__pyx_r = NULL;
3275 __Pyx_RefNannyDeclarations
3280 Py_ssize_t __pyx_t_5;
3281 Py_ssize_t __pyx_t_6;
3283 Py_ssize_t __pyx_t_8;
3284 Py_ssize_t __pyx_t_9;
3285 Py_ssize_t __pyx_t_10;
3286 Py_ssize_t __pyx_t_11;
3287 npy_intp __pyx_t_12;
3288 PyObject *__pyx_t_13 = NULL;
3289 PyObject *__pyx_t_14 = NULL;
3290 PyObject *__pyx_t_15 = NULL;
3291 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_16;
3292 Py_ssize_t __pyx_t_17;
3293 Py_ssize_t __pyx_t_18;
3294 Py_ssize_t __pyx_t_19;
3296 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3297 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3298 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3299 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3300 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3301 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3302 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3303 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3304 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3305 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3306 __pyx_pybuffer_ebq_vals.refcount = 0;
3307 __pyx_pybuffernd_ebq_vals.data = NULL;
3308 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3310 __Pyx_BufFmt_StackElem __pyx_stack[1];
3311 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3313 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3315 __Pyx_BufFmt_StackElem __pyx_stack[1];
3316 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3318 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3320 __Pyx_BufFmt_StackElem __pyx_stack[1];
3321 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 69, __pyx_L1_error)
3323 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3332 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3333 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3334 __pyx_v_eN = __pyx_t_2;
3343 __pyx_t_3 = (__pyx_v_ebq_vals->dimensions[1]);
3344 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3345 __pyx_v_ebN_local = __pyx_t_4;
3354 __pyx_t_5 = __pyx_v_eN;
3355 __pyx_t_6 = __pyx_v_ebN_local;
3357 if (__pyx_t_5 < 0) {
3358 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3359 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
3360 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
3361 if (__pyx_t_6 < 0) {
3362 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3363 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
3364 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
3365 if (unlikely(__pyx_t_7 != -1)) {
3366 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3367 __PYX_ERR(0, 84, __pyx_L1_error)
3369 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3378 __pyx_t_8 = __pyx_v_ebN;
3381 if (__pyx_t_8 < 0) {
3382 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3383 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
3384 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3385 if (__pyx_t_9 < 0) {
3386 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3387 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
3388 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3389 if (unlikely(__pyx_t_7 != -1)) {
3390 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3391 __PYX_ERR(0, 85, __pyx_L1_error)
3393 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3402 __pyx_t_10 = __pyx_v_ebN;
3405 if (__pyx_t_10 < 0) {
3406 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3407 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
3408 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3409 if (__pyx_t_11 < 0) {
3410 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3411 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
3412 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3413 if (unlikely(__pyx_t_7 != -1)) {
3414 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3415 __PYX_ERR(0, 86, __pyx_L1_error)
3417 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3426 __pyx_t_12 = (__pyx_v_ebq_vals->dimensions[2]);
3427 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
3428 __pyx_v_k = __pyx_t_7;
3437 if (unlikely(__pyx_v_material_functions == Py_None)) {
3438 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3439 __PYX_ERR(0, 88, __pyx_L1_error)
3441 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error)
3442 __Pyx_GOTREF(__pyx_t_13);
3443 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 88, __pyx_L1_error)
3444 __Pyx_GOTREF(__pyx_t_14);
3445 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3454 if (unlikely(__pyx_v_material_functions == Py_None)) {
3455 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3456 __PYX_ERR(0, 89, __pyx_L1_error)
3458 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 89, __pyx_L1_error)
3459 __Pyx_GOTREF(__pyx_t_13);
3460 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 89, __pyx_L1_error)
3461 __Pyx_GOTREF(__pyx_t_15);
3462 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3471 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 88, __pyx_L1_error)
3472 __Pyx_GOTREF(__pyx_t_13);
3473 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3474 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3475 __pyx_t_15 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 88, __pyx_L1_error)
3476 __Pyx_GOTREF(__pyx_t_15);
3477 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3478 __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_16 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3479 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3480 __pyx_t_17 = __pyx_v_eN;
3481 __pyx_t_18 = __pyx_v_ebN_local;
3482 __pyx_t_19 = __pyx_v_k;
3484 if (__pyx_t_17 < 0) {
3485 __pyx_t_17 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3486 if (unlikely(__pyx_t_17 < 0)) __pyx_t_20 = 0;
3487 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_20 = 0;
3488 if (__pyx_t_18 < 0) {
3489 __pyx_t_18 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3490 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 1;
3491 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_20 = 1;
3492 if (__pyx_t_19 < 0) {
3493 __pyx_t_19 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3494 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 2;
3495 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_20 = 2;
3496 if (unlikely(__pyx_t_20 != -1)) {
3497 __Pyx_RaiseBufferIndexError(__pyx_t_20);
3498 __PYX_ERR(0, 88, __pyx_L1_error)
3500 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_16;
3514 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3517 __Pyx_XDECREF(__pyx_t_13);
3518 __Pyx_XDECREF(__pyx_t_14);
3519 __Pyx_XDECREF(__pyx_t_15);
3520 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3521 __Pyx_PyThreadState_declare
3522 __Pyx_PyThreadState_assign
3523 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3524 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3525 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3526 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3527 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3528 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3532 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3533 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3534 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3536 __Pyx_XGIVEREF(__pyx_r);
3537 __Pyx_RefNannyFinishContext();
3550 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3551 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3552 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3553 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3555 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3556 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3557 PyArrayObject *__pyx_v_ebq_vals = 0;
3558 PyObject *__pyx_v_material_functions = 0;
3559 PyObject *__pyx_r = 0;
3560 __Pyx_RefNannyDeclarations
3561 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3563 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3564 PyObject* values[5] = {0,0,0,0,0};
3565 if (unlikely(__pyx_kwds)) {
3567 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3569 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3570 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3571 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3572 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3573 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3575 default:
goto __pyx_L5_argtuple_error;
3577 kw_args = PyDict_Size(__pyx_kwds);
3580 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3581 else goto __pyx_L5_argtuple_error;
3583 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3585 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 91, __pyx_L3_error)
3588 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3590 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 91, __pyx_L3_error)
3593 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3595 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 91, __pyx_L3_error)
3598 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3600 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 91, __pyx_L3_error)
3603 if (unlikely(kw_args > 0)) {
3604 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
3606 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3607 goto __pyx_L5_argtuple_error;
3609 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3610 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3611 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3612 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3613 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3615 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
3616 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3617 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3618 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3619 __pyx_v_material_functions = ((PyObject*)values[4]);
3621 goto __pyx_L4_argument_unpacking_done;
3622 __pyx_L5_argtuple_error:;
3623 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 91, __pyx_L3_error)
3625 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3626 __Pyx_RefNannyFinishContext();
3628 __pyx_L4_argument_unpacking_done:;
3629 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 92, __pyx_L1_error)
3630 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 93, __pyx_L1_error)
3631 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 94, __pyx_L1_error)
3632 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 95, __pyx_L1_error)
3633 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3640 __Pyx_RefNannyFinishContext();
3644 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3647 int __pyx_v_ebN_local;
3649 int __pyx_v_material_left;
3650 int __pyx_v_material_right;
3653 double __pyx_v_numer;
3654 double __pyx_v_denom;
3655 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3656 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3657 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3658 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3659 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3660 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3661 PyObject *__pyx_r = NULL;
3662 __Pyx_RefNannyDeclarations
3667 Py_ssize_t __pyx_t_5;
3668 Py_ssize_t __pyx_t_6;
3670 Py_ssize_t __pyx_t_8;
3671 Py_ssize_t __pyx_t_9;
3672 Py_ssize_t __pyx_t_10;
3673 Py_ssize_t __pyx_t_11;
3674 npy_intp __pyx_t_12;
3679 PyObject *__pyx_t_17 = NULL;
3680 PyObject *__pyx_t_18 = NULL;
3681 PyObject *__pyx_t_19 = NULL;
3682 PyObject *__pyx_t_20 = NULL;
3683 PyObject *__pyx_t_21 = NULL;
3685 Py_ssize_t __pyx_t_23;
3686 Py_ssize_t __pyx_t_24;
3687 Py_ssize_t __pyx_t_25;
3688 Py_ssize_t __pyx_t_26;
3690 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
3691 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3692 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3693 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3694 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3695 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3696 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3697 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3698 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3699 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3700 __pyx_pybuffer_ebq_vals.refcount = 0;
3701 __pyx_pybuffernd_ebq_vals.data = NULL;
3702 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3704 __Pyx_BufFmt_StackElem __pyx_stack[1];
3705 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3707 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3709 __Pyx_BufFmt_StackElem __pyx_stack[1];
3710 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3712 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3714 __Pyx_BufFmt_StackElem __pyx_stack[1];
3715 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 91, __pyx_L1_error)
3717 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
3726 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3727 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3728 __pyx_v_eN = __pyx_t_2;
3737 __pyx_t_3 = (__pyx_v_ebq_vals->dimensions[1]);
3738 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3739 __pyx_v_ebN_local = __pyx_t_4;
3748 __pyx_t_5 = __pyx_v_eN;
3749 __pyx_t_6 = __pyx_v_ebN_local;
3751 if (__pyx_t_5 < 0) {
3752 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3753 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
3754 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
3755 if (__pyx_t_6 < 0) {
3756 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3757 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
3758 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
3759 if (unlikely(__pyx_t_7 != -1)) {
3760 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3761 __PYX_ERR(0, 108, __pyx_L1_error)
3763 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3772 __pyx_t_8 = __pyx_v_ebN;
3775 if (__pyx_t_8 < 0) {
3776 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3777 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
3778 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3779 if (__pyx_t_9 < 0) {
3780 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3781 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
3782 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3783 if (unlikely(__pyx_t_7 != -1)) {
3784 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3785 __PYX_ERR(0, 109, __pyx_L1_error)
3787 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3796 __pyx_t_10 = __pyx_v_ebN;
3799 if (__pyx_t_10 < 0) {
3800 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3801 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
3802 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3803 if (__pyx_t_11 < 0) {
3804 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3805 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
3806 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3807 if (unlikely(__pyx_t_7 != -1)) {
3808 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3809 __PYX_ERR(0, 110, __pyx_L1_error)
3811 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3820 __pyx_t_12 = (__pyx_v_ebq_vals->dimensions[2]);
3821 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
3822 __pyx_v_k = __pyx_t_7;
3831 __pyx_t_13 = __pyx_v_nd;
3832 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
3833 __pyx_v_I = __pyx_t_14;
3842 __pyx_t_15 = __pyx_v_nd;
3843 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
3844 __pyx_v_J = __pyx_t_16;
3853 if (unlikely(__pyx_v_material_functions == Py_None)) {
3854 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3855 __PYX_ERR(0, 114, __pyx_L1_error)
3857 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 114, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_17);
3859 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
3860 __Pyx_GOTREF(__pyx_t_18);
3861 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3862 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 114, __pyx_L1_error)
3863 __Pyx_GOTREF(__pyx_t_17);
3864 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
3865 __Pyx_GOTREF(__pyx_t_19);
3866 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
3867 __Pyx_GOTREF(__pyx_t_20);
3868 __Pyx_GIVEREF(__pyx_t_17);
3869 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
3870 __Pyx_GIVEREF(__pyx_t_19);
3871 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
3874 __pyx_t_19 = PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
3875 __Pyx_GOTREF(__pyx_t_19);
3876 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3877 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3878 __pyx_t_20 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 114, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_20);
3880 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3881 if (unlikely(__pyx_v_material_functions == Py_None)) {
3882 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3883 __PYX_ERR(0, 114, __pyx_L1_error)
3885 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
3886 __Pyx_GOTREF(__pyx_t_19);
3887 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 114, __pyx_L1_error)
3888 __Pyx_GOTREF(__pyx_t_18);
3889 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3890 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 114, __pyx_L1_error)
3891 __Pyx_GOTREF(__pyx_t_19);
3892 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 114, __pyx_L1_error)
3893 __Pyx_GOTREF(__pyx_t_17);
3894 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
3895 __Pyx_GOTREF(__pyx_t_21);
3896 __Pyx_GIVEREF(__pyx_t_19);
3897 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
3898 __Pyx_GIVEREF(__pyx_t_17);
3899 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_17);
3902 __pyx_t_17 = PyObject_GetItem(__pyx_t_18, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 114, __pyx_L1_error)
3903 __Pyx_GOTREF(__pyx_t_17);
3904 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3905 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3906 __pyx_t_21 = PyNumber_Multiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 114, __pyx_L1_error)
3907 __Pyx_GOTREF(__pyx_t_21);
3908 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3909 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3910 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
3911 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3912 __pyx_v_numer = __pyx_t_22;
3921 if (unlikely(__pyx_v_material_functions == Py_None)) {
3922 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3923 __PYX_ERR(0, 115, __pyx_L1_error)
3925 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
3926 __Pyx_GOTREF(__pyx_t_21);
3927 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_21);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 115, __pyx_L1_error)
3928 __Pyx_GOTREF(__pyx_t_17);
3929 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3930 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
3931 __Pyx_GOTREF(__pyx_t_21);
3932 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
3933 __Pyx_GOTREF(__pyx_t_20);
3934 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
3935 __Pyx_GOTREF(__pyx_t_18);
3936 __Pyx_GIVEREF(__pyx_t_21);
3937 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_21);
3938 __Pyx_GIVEREF(__pyx_t_20);
3939 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
3942 __pyx_t_20 = PyObject_GetItem(__pyx_t_17, __pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 115, __pyx_L1_error)
3943 __Pyx_GOTREF(__pyx_t_20);
3944 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3945 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3946 if (unlikely(__pyx_v_material_functions == Py_None)) {
3947 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3948 __PYX_ERR(0, 115, __pyx_L1_error)
3950 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
3951 __Pyx_GOTREF(__pyx_t_18);
3952 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 115, __pyx_L1_error)
3953 __Pyx_GOTREF(__pyx_t_17);
3954 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3955 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 115, __pyx_L1_error)
3956 __Pyx_GOTREF(__pyx_t_18);
3957 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
3958 __Pyx_GOTREF(__pyx_t_21);
3959 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
3960 __Pyx_GOTREF(__pyx_t_19);
3961 __Pyx_GIVEREF(__pyx_t_18);
3962 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18);
3963 __Pyx_GIVEREF(__pyx_t_21);
3964 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
3967 __pyx_t_21 = PyObject_GetItem(__pyx_t_17, __pyx_t_19);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
3968 __Pyx_GOTREF(__pyx_t_21);
3969 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3970 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3971 __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_t_21);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 115, __pyx_L1_error)
3972 __Pyx_GOTREF(__pyx_t_19);
3973 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3974 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3975 __pyx_t_21 = __Pyx_PyFloat_AddObjC(__pyx_t_19, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 115, __pyx_L1_error)
3976 __Pyx_GOTREF(__pyx_t_21);
3977 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3978 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
3979 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3980 __pyx_v_denom = __pyx_t_22;
3989 if (unlikely(__pyx_v_denom == 0)) {
3990 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
3991 __PYX_ERR(0, 116, __pyx_L1_error)
3993 __pyx_t_23 = __pyx_v_eN;
3994 __pyx_t_24 = __pyx_v_ebN_local;
3995 __pyx_t_25 = __pyx_v_k;
3996 __pyx_t_26 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
3998 if (__pyx_t_23 < 0) {
3999 __pyx_t_23 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
4000 if (unlikely(__pyx_t_23 < 0)) __pyx_t_27 = 0;
4001 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_27 = 0;
4002 if (__pyx_t_24 < 0) {
4003 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
4004 if (unlikely(__pyx_t_24 < 0)) __pyx_t_27 = 1;
4005 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_27 = 1;
4006 if (__pyx_t_25 < 0) {
4007 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
4008 if (unlikely(__pyx_t_25 < 0)) __pyx_t_27 = 2;
4009 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_27 = 2;
4010 if (__pyx_t_26 < 0) {
4011 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
4012 if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 3;
4013 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_27 = 3;
4014 if (unlikely(__pyx_t_27 != -1)) {
4015 __Pyx_RaiseBufferIndexError(__pyx_t_27);
4016 __PYX_ERR(0, 116, __pyx_L1_error)
4018 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
4034 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4037 __Pyx_XDECREF(__pyx_t_17);
4038 __Pyx_XDECREF(__pyx_t_18);
4039 __Pyx_XDECREF(__pyx_t_19);
4040 __Pyx_XDECREF(__pyx_t_20);
4041 __Pyx_XDECREF(__pyx_t_21);
4042 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4043 __Pyx_PyThreadState_declare
4044 __Pyx_PyThreadState_assign
4045 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4046 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4047 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4048 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4049 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4050 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4054 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
4055 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4056 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4058 __Pyx_XGIVEREF(__pyx_r);
4059 __Pyx_RefNannyFinishContext();
4072 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4073 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4074 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
4075 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4076 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4077 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4078 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4079 PyObject *__pyx_v_material_functions = 0;
4080 PyObject *__pyx_r = 0;
4081 __Pyx_RefNannyDeclarations
4082 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
4084 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4085 PyObject* values[4] = {0,0,0,0};
4086 if (unlikely(__pyx_kwds)) {
4088 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4090 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4091 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4092 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4093 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4095 default:
goto __pyx_L5_argtuple_error;
4097 kw_args = PyDict_Size(__pyx_kwds);
4100 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4101 else goto __pyx_L5_argtuple_error;
4103 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4105 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4108 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4110 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4113 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4115 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); __PYX_ERR(0, 118, __pyx_L3_error)
4118 if (unlikely(kw_args > 0)) {
4119 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4121 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
4122 goto __pyx_L5_argtuple_error;
4124 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4125 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4126 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4127 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4129 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
4130 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
4131 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
4132 __pyx_v_material_functions = ((PyObject*)values[3]);
4134 goto __pyx_L4_argument_unpacking_done;
4135 __pyx_L5_argtuple_error:;
4136 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4138 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4139 __Pyx_RefNannyFinishContext();
4141 __pyx_L4_argument_unpacking_done:;
4142 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 118, __pyx_L1_error)
4143 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 119, __pyx_L1_error)
4144 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 120, __pyx_L1_error)
4145 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
4146 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4153 __Pyx_RefNannyFinishContext();
4157 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4159 int __pyx_v_material_left;
4160 int __pyx_v_material_right;
4162 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4163 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4164 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4165 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4166 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4167 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4168 PyObject *__pyx_r = NULL;
4169 __Pyx_RefNannyDeclarations
4172 Py_ssize_t __pyx_t_3;
4173 Py_ssize_t __pyx_t_4;
4175 Py_ssize_t __pyx_t_6;
4176 Py_ssize_t __pyx_t_7;
4179 PyObject *__pyx_t_10 = NULL;
4180 PyObject *__pyx_t_11 = NULL;
4181 PyObject *__pyx_t_12 = NULL;
4182 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4183 Py_ssize_t __pyx_t_14;
4184 Py_ssize_t __pyx_t_15;
4185 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
4186 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4187 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4188 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4189 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4190 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4191 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4192 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4193 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4194 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4195 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4196 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4197 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4199 __Pyx_BufFmt_StackElem __pyx_stack[1];
4200 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4202 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4204 __Pyx_BufFmt_StackElem __pyx_stack[1];
4205 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4207 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4209 __Pyx_BufFmt_StackElem __pyx_stack[1];
4210 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 118, __pyx_L1_error)
4212 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
4221 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4222 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
4223 __pyx_v_ebN = __pyx_t_2;
4232 __pyx_t_3 = __pyx_v_ebN;
4235 if (__pyx_t_3 < 0) {
4236 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4237 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
4238 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4239 if (__pyx_t_4 < 0) {
4240 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4241 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
4242 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4243 if (unlikely(__pyx_t_5 != -1)) {
4244 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4245 __PYX_ERR(0, 132, __pyx_L1_error)
4247 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4256 __pyx_t_6 = __pyx_v_ebN;
4259 if (__pyx_t_6 < 0) {
4260 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4261 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
4262 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4263 if (__pyx_t_7 < 0) {
4264 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4265 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
4266 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4267 if (unlikely(__pyx_t_5 != -1)) {
4268 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4269 __PYX_ERR(0, 133, __pyx_L1_error)
4271 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4280 __pyx_t_8 = (__pyx_v_ebq_global_vals->dimensions[1]);
4281 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4282 __pyx_v_k = __pyx_t_9;
4291 if (unlikely(__pyx_v_material_functions == Py_None)) {
4292 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4293 __PYX_ERR(0, 135, __pyx_L1_error)
4295 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4296 __Pyx_GOTREF(__pyx_t_10);
4297 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 135, __pyx_L1_error)
4298 __Pyx_GOTREF(__pyx_t_11);
4299 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4308 if (unlikely(__pyx_v_material_functions == Py_None)) {
4309 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4310 __PYX_ERR(0, 136, __pyx_L1_error)
4312 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 136, __pyx_L1_error)
4313 __Pyx_GOTREF(__pyx_t_10);
4314 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 136, __pyx_L1_error)
4315 __Pyx_GOTREF(__pyx_t_12);
4316 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4325 __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 135, __pyx_L1_error)
4326 __Pyx_GOTREF(__pyx_t_10);
4327 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4328 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4329 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 135, __pyx_L1_error)
4330 __Pyx_GOTREF(__pyx_t_12);
4331 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4332 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
4333 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4334 __pyx_t_14 = __pyx_v_ebN;
4335 __pyx_t_15 = __pyx_v_k;
4337 if (__pyx_t_14 < 0) {
4338 __pyx_t_14 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4339 if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0;
4340 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_5 = 0;
4341 if (__pyx_t_15 < 0) {
4342 __pyx_t_15 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4343 if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 1;
4344 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_5 = 1;
4345 if (unlikely(__pyx_t_5 != -1)) {
4346 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4347 __PYX_ERR(0, 135, __pyx_L1_error)
4349 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_13;
4362 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4365 __Pyx_XDECREF(__pyx_t_10);
4366 __Pyx_XDECREF(__pyx_t_11);
4367 __Pyx_XDECREF(__pyx_t_12);
4368 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4369 __Pyx_PyThreadState_declare
4370 __Pyx_PyThreadState_assign
4371 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4372 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4373 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4374 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4375 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4376 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4380 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4381 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4382 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4384 __Pyx_XGIVEREF(__pyx_r);
4385 __Pyx_RefNannyFinishContext();
4398 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4399 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4400 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4401 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4403 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4404 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4405 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4406 PyObject *__pyx_v_material_functions = 0;
4407 PyObject *__pyx_r = 0;
4408 __Pyx_RefNannyDeclarations
4409 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4411 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4412 PyObject* values[5] = {0,0,0,0,0};
4413 if (unlikely(__pyx_kwds)) {
4415 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4417 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4418 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4419 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4420 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4421 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4423 default:
goto __pyx_L5_argtuple_error;
4425 kw_args = PyDict_Size(__pyx_kwds);
4428 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4429 else goto __pyx_L5_argtuple_error;
4431 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4433 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); __PYX_ERR(0, 139, __pyx_L3_error)
4436 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4438 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); __PYX_ERR(0, 139, __pyx_L3_error)
4441 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4443 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); __PYX_ERR(0, 139, __pyx_L3_error)
4446 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4448 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); __PYX_ERR(0, 139, __pyx_L3_error)
4451 if (unlikely(kw_args > 0)) {
4452 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 139, __pyx_L3_error)
4454 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4455 goto __pyx_L5_argtuple_error;
4457 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4458 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4459 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4460 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4461 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4463 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 139, __pyx_L3_error)
4464 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4465 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4466 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4467 __pyx_v_material_functions = ((PyObject*)values[4]);
4469 goto __pyx_L4_argument_unpacking_done;
4470 __pyx_L5_argtuple_error:;
4471 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 139, __pyx_L3_error)
4473 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4474 __Pyx_RefNannyFinishContext();
4476 __pyx_L4_argument_unpacking_done:;
4477 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 140, __pyx_L1_error)
4478 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 141, __pyx_L1_error)
4479 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 142, __pyx_L1_error)
4480 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 143, __pyx_L1_error)
4481 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4488 __Pyx_RefNannyFinishContext();
4492 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4495 int __pyx_v_material_left;
4496 int __pyx_v_material_right;
4499 double __pyx_v_numer;
4500 double __pyx_v_denom;
4501 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4502 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4503 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4504 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4505 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4506 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4507 PyObject *__pyx_r = NULL;
4508 __Pyx_RefNannyDeclarations
4511 Py_ssize_t __pyx_t_3;
4512 Py_ssize_t __pyx_t_4;
4514 Py_ssize_t __pyx_t_6;
4515 Py_ssize_t __pyx_t_7;
4521 PyObject *__pyx_t_13 = NULL;
4522 PyObject *__pyx_t_14 = NULL;
4523 PyObject *__pyx_t_15 = NULL;
4524 PyObject *__pyx_t_16 = NULL;
4525 PyObject *__pyx_t_17 = NULL;
4527 Py_ssize_t __pyx_t_19;
4528 Py_ssize_t __pyx_t_20;
4529 Py_ssize_t __pyx_t_21;
4531 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4532 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4533 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4534 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4535 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4536 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4537 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4538 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4539 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4540 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4541 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4542 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4543 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4545 __Pyx_BufFmt_StackElem __pyx_stack[1];
4546 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4548 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4550 __Pyx_BufFmt_StackElem __pyx_stack[1];
4551 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4553 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4555 __Pyx_BufFmt_StackElem __pyx_stack[1];
4556 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 139, __pyx_L1_error)
4558 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4567 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4568 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
4569 __pyx_v_ebN = __pyx_t_2;
4578 __pyx_t_3 = __pyx_v_ebN;
4581 if (__pyx_t_3 < 0) {
4582 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4583 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
4584 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4585 if (__pyx_t_4 < 0) {
4586 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4587 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
4588 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4589 if (unlikely(__pyx_t_5 != -1)) {
4590 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4591 __PYX_ERR(0, 155, __pyx_L1_error)
4593 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4602 __pyx_t_6 = __pyx_v_ebN;
4605 if (__pyx_t_6 < 0) {
4606 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4607 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
4608 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4609 if (__pyx_t_7 < 0) {
4610 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4611 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
4612 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4613 if (unlikely(__pyx_t_5 != -1)) {
4614 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4615 __PYX_ERR(0, 156, __pyx_L1_error)
4617 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4626 __pyx_t_8 = (__pyx_v_ebq_global_vals->dimensions[1]);
4627 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
4628 __pyx_v_k = __pyx_t_5;
4637 __pyx_t_9 = __pyx_v_nd;
4638 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
4639 __pyx_v_I = __pyx_t_10;
4648 __pyx_t_11 = __pyx_v_nd;
4649 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
4650 __pyx_v_J = __pyx_t_12;
4659 if (unlikely(__pyx_v_material_functions == Py_None)) {
4660 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4661 __PYX_ERR(0, 160, __pyx_L1_error)
4663 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 160, __pyx_L1_error)
4664 __Pyx_GOTREF(__pyx_t_13);
4665 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
4666 __Pyx_GOTREF(__pyx_t_14);
4667 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4668 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 160, __pyx_L1_error)
4669 __Pyx_GOTREF(__pyx_t_13);
4670 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
4671 __Pyx_GOTREF(__pyx_t_15);
4672 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
4673 __Pyx_GOTREF(__pyx_t_16);
4674 __Pyx_GIVEREF(__pyx_t_13);
4675 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_13);
4676 __Pyx_GIVEREF(__pyx_t_15);
4677 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
4680 __pyx_t_15 = PyObject_GetItem(__pyx_t_14, __pyx_t_16);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
4681 __Pyx_GOTREF(__pyx_t_15);
4682 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4683 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4684 __pyx_t_16 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 160, __pyx_L1_error)
4685 __Pyx_GOTREF(__pyx_t_16);
4686 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4687 if (unlikely(__pyx_v_material_functions == Py_None)) {
4688 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4689 __PYX_ERR(0, 160, __pyx_L1_error)
4691 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
4692 __Pyx_GOTREF(__pyx_t_15);
4693 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 160, __pyx_L1_error)
4694 __Pyx_GOTREF(__pyx_t_14);
4695 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4696 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 160, __pyx_L1_error)
4697 __Pyx_GOTREF(__pyx_t_15);
4698 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 160, __pyx_L1_error)
4699 __Pyx_GOTREF(__pyx_t_13);
4700 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4701 __Pyx_GOTREF(__pyx_t_17);
4702 __Pyx_GIVEREF(__pyx_t_15);
4703 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
4704 __Pyx_GIVEREF(__pyx_t_13);
4705 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_13);
4708 __pyx_t_13 = PyObject_GetItem(__pyx_t_14, __pyx_t_17);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 160, __pyx_L1_error)
4709 __Pyx_GOTREF(__pyx_t_13);
4710 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4711 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4712 __pyx_t_17 = PyNumber_Multiply(__pyx_t_16, __pyx_t_13);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 160, __pyx_L1_error)
4713 __Pyx_GOTREF(__pyx_t_17);
4714 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4715 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4716 __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_18 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
4717 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4718 __pyx_v_numer = __pyx_t_18;
4727 if (unlikely(__pyx_v_material_functions == Py_None)) {
4728 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4729 __PYX_ERR(0, 161, __pyx_L1_error)
4731 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
4732 __Pyx_GOTREF(__pyx_t_17);
4733 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 161, __pyx_L1_error)
4734 __Pyx_GOTREF(__pyx_t_13);
4735 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4736 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
4737 __Pyx_GOTREF(__pyx_t_17);
4738 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
4739 __Pyx_GOTREF(__pyx_t_16);
4740 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
4741 __Pyx_GOTREF(__pyx_t_14);
4742 __Pyx_GIVEREF(__pyx_t_17);
4743 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17);
4744 __Pyx_GIVEREF(__pyx_t_16);
4745 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16);
4748 __pyx_t_16 = PyObject_GetItem(__pyx_t_13, __pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 161, __pyx_L1_error)
4749 __Pyx_GOTREF(__pyx_t_16);
4750 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4751 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4752 if (unlikely(__pyx_v_material_functions == Py_None)) {
4753 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4754 __PYX_ERR(0, 161, __pyx_L1_error)
4756 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
4757 __Pyx_GOTREF(__pyx_t_14);
4758 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 161, __pyx_L1_error)
4759 __Pyx_GOTREF(__pyx_t_13);
4760 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4761 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 161, __pyx_L1_error)
4762 __Pyx_GOTREF(__pyx_t_14);
4763 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
4764 __Pyx_GOTREF(__pyx_t_17);
4765 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
4766 __Pyx_GOTREF(__pyx_t_15);
4767 __Pyx_GIVEREF(__pyx_t_14);
4768 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
4769 __Pyx_GIVEREF(__pyx_t_17);
4770 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_17);
4773 __pyx_t_17 = PyObject_GetItem(__pyx_t_13, __pyx_t_15);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
4774 __Pyx_GOTREF(__pyx_t_17);
4775 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4776 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4777 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 161, __pyx_L1_error)
4778 __Pyx_GOTREF(__pyx_t_15);
4779 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4780 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4781 __pyx_t_17 = __Pyx_PyFloat_AddObjC(__pyx_t_15, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 161, __pyx_L1_error)
4782 __Pyx_GOTREF(__pyx_t_17);
4783 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4784 __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_18 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
4785 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4786 __pyx_v_denom = __pyx_t_18;
4795 if (unlikely(__pyx_v_denom == 0)) {
4796 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4797 __PYX_ERR(0, 162, __pyx_L1_error)
4799 __pyx_t_19 = __pyx_v_ebN;
4800 __pyx_t_20 = __pyx_v_k;
4801 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4803 if (__pyx_t_19 < 0) {
4804 __pyx_t_19 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4805 if (unlikely(__pyx_t_19 < 0)) __pyx_t_22 = 0;
4806 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
4807 if (__pyx_t_20 < 0) {
4808 __pyx_t_20 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4809 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 1;
4810 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
4811 if (__pyx_t_21 < 0) {
4812 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
4813 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
4814 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
4815 if (unlikely(__pyx_t_22 != -1)) {
4816 __Pyx_RaiseBufferIndexError(__pyx_t_22);
4817 __PYX_ERR(0, 162, __pyx_L1_error)
4819 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
4834 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4837 __Pyx_XDECREF(__pyx_t_13);
4838 __Pyx_XDECREF(__pyx_t_14);
4839 __Pyx_XDECREF(__pyx_t_15);
4840 __Pyx_XDECREF(__pyx_t_16);
4841 __Pyx_XDECREF(__pyx_t_17);
4842 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4843 __Pyx_PyThreadState_declare
4844 __Pyx_PyThreadState_assign
4845 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4846 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4847 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4848 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4849 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4850 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4854 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4855 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4856 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4858 __Pyx_XGIVEREF(__pyx_r);
4859 __Pyx_RefNannyFinishContext();
4872 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4873 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
4874 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
4875 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4877 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
4878 PyArrayObject *__pyx_v_x = 0;
4879 PyArrayObject *__pyx_v_q_vals = 0;
4880 PyObject *__pyx_v_material_functions = 0;
4881 PyObject *__pyx_r = 0;
4882 __Pyx_RefNannyDeclarations
4883 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
4885 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
4886 PyObject* values[5] = {0,0,0,0,0};
4887 if (unlikely(__pyx_kwds)) {
4889 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4891 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4892 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4893 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4894 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4895 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4897 default:
goto __pyx_L5_argtuple_error;
4899 kw_args = PyDict_Size(__pyx_kwds);
4902 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4903 else goto __pyx_L5_argtuple_error;
4905 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
4907 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 165, __pyx_L3_error)
4910 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4912 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 165, __pyx_L3_error)
4915 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
4917 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 165, __pyx_L3_error)
4920 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4922 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 165, __pyx_L3_error)
4925 if (unlikely(kw_args > 0)) {
4926 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 165, __pyx_L3_error)
4928 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4929 goto __pyx_L5_argtuple_error;
4931 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4932 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4933 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4934 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4935 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4937 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L3_error)
4938 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
4939 __pyx_v_x = ((PyArrayObject *)values[2]);
4940 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
4941 __pyx_v_material_functions = ((PyObject*)values[4]);
4943 goto __pyx_L4_argument_unpacking_done;
4944 __pyx_L5_argtuple_error:;
4945 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 165, __pyx_L3_error)
4947 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4948 __Pyx_RefNannyFinishContext();
4950 __pyx_L4_argument_unpacking_done:;
4951 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 166, __pyx_L1_error)
4952 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 167, __pyx_L1_error)
4953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 168, __pyx_L1_error)
4954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 169, __pyx_L1_error)
4955 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
4962 __Pyx_RefNannyFinishContext();
4966 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
4969 int __pyx_v_material;
4970 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
4971 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
4972 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
4973 __Pyx_Buffer __pyx_pybuffer_q_vals;
4974 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
4975 __Pyx_Buffer __pyx_pybuffer_x;
4976 PyObject *__pyx_r = NULL;
4977 __Pyx_RefNannyDeclarations
4980 Py_ssize_t __pyx_t_3;
4983 PyObject *__pyx_t_6 = NULL;
4984 PyObject *__pyx_t_7 = NULL;
4985 PyObject *__pyx_t_8 = NULL;
4986 PyObject *__pyx_t_9 = NULL;
4987 PyObject *__pyx_t_10 = NULL;
4989 PyObject *__pyx_t_12 = NULL;
4990 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4991 Py_ssize_t __pyx_t_14;
4992 Py_ssize_t __pyx_t_15;
4993 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
4994 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
4995 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
4996 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
4997 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
4998 __pyx_pybuffer_x.pybuffer.buf = NULL;
4999 __pyx_pybuffer_x.refcount = 0;
5000 __pyx_pybuffernd_x.data = NULL;
5001 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5002 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5003 __pyx_pybuffer_q_vals.refcount = 0;
5004 __pyx_pybuffernd_q_vals.data = NULL;
5005 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5007 __Pyx_BufFmt_StackElem __pyx_stack[1];
5008 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5010 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5012 __Pyx_BufFmt_StackElem __pyx_stack[1];
5013 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5015 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5017 __Pyx_BufFmt_StackElem __pyx_stack[1];
5018 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 165, __pyx_L1_error)
5020 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
5029 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5030 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5031 __pyx_v_eN = __pyx_t_2;
5040 __pyx_t_3 = __pyx_v_eN;
5042 if (__pyx_t_3 < 0) {
5043 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5044 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
5045 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
5046 if (unlikely(__pyx_t_4 != -1)) {
5047 __Pyx_RaiseBufferIndexError(__pyx_t_4);
5048 __PYX_ERR(0, 176, __pyx_L1_error)
5050 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5059 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
5060 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
5061 __pyx_v_k = __pyx_t_4;
5070 if (unlikely(__pyx_v_material_functions == Py_None)) {
5071 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5072 __PYX_ERR(0, 178, __pyx_L1_error)
5074 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
5075 __Pyx_GOTREF(__pyx_t_7);
5076 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 178, __pyx_L1_error)
5077 __Pyx_GOTREF(__pyx_t_8);
5078 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5079 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 178, __pyx_L1_error)
5080 __Pyx_GOTREF(__pyx_t_7);
5081 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5082 __Pyx_GOTREF(__pyx_t_9);
5083 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5084 __Pyx_GOTREF(__pyx_t_10);
5085 __Pyx_GIVEREF(__pyx_t_7);
5086 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
5087 __Pyx_GIVEREF(__pyx_t_9);
5088 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
5091 __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error)
5092 __Pyx_GOTREF(__pyx_t_9);
5093 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5094 __pyx_t_10 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 178, __pyx_L1_error)
5095 __Pyx_GOTREF(__pyx_t_10);
5098 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5099 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
5100 if (likely(__pyx_t_7)) {
5101 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5102 __Pyx_INCREF(__pyx_t_7);
5103 __Pyx_INCREF(
function);
5104 __Pyx_DECREF_SET(__pyx_t_8,
function);
5108 #if CYTHON_FAST_PYCALL 5109 if (PyFunction_Check(__pyx_t_8)) {
5110 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_t_10};
5111 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
5112 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5113 __Pyx_GOTREF(__pyx_t_6);
5114 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5115 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5118 #if CYTHON_FAST_PYCCALL 5119 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
5120 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_t_10};
5121 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
5122 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5123 __Pyx_GOTREF(__pyx_t_6);
5124 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5125 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5129 __pyx_t_12 = PyTuple_New(2+__pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 178, __pyx_L1_error)
5130 __Pyx_GOTREF(__pyx_t_12);
5132 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
5134 __Pyx_GIVEREF(__pyx_t_9);
5135 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_9);
5136 __Pyx_GIVEREF(__pyx_t_10);
5137 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
5140 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
5141 __Pyx_GOTREF(__pyx_t_6);
5142 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5144 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5145 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6);
if (unlikely((__pyx_t_13 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
5146 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5147 __pyx_t_14 = __pyx_v_eN;
5148 __pyx_t_15 = __pyx_v_k;
5150 if (__pyx_t_14 < 0) {
5151 __pyx_t_14 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
5152 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 0;
5153 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_11 = 0;
5154 if (__pyx_t_15 < 0) {
5155 __pyx_t_15 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
5156 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 1;
5157 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_11 = 1;
5158 if (unlikely(__pyx_t_11 != -1)) {
5159 __Pyx_RaiseBufferIndexError(__pyx_t_11);
5160 __PYX_ERR(0, 178, __pyx_L1_error)
5162 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_13;
5175 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5178 __Pyx_XDECREF(__pyx_t_6);
5179 __Pyx_XDECREF(__pyx_t_7);
5180 __Pyx_XDECREF(__pyx_t_8);
5181 __Pyx_XDECREF(__pyx_t_9);
5182 __Pyx_XDECREF(__pyx_t_10);
5183 __Pyx_XDECREF(__pyx_t_12);
5184 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5185 __Pyx_PyThreadState_declare
5186 __Pyx_PyThreadState_assign
5187 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5188 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5189 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5190 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5191 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5192 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5196 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5197 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5198 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5200 __Pyx_XGIVEREF(__pyx_r);
5201 __Pyx_RefNannyFinishContext();
5214 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5215 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
5216 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
5217 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5219 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
5220 PyArrayObject *__pyx_v_x = 0;
5221 PyArrayObject *__pyx_v_q_vals = 0;
5222 PyObject *__pyx_v_material_functions = 0;
5223 PyObject *__pyx_r = 0;
5224 __Pyx_RefNannyDeclarations
5225 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
5227 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
5228 PyObject* values[5] = {0,0,0,0,0};
5229 if (unlikely(__pyx_kwds)) {
5231 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5233 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5234 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5235 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5236 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5237 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5239 default:
goto __pyx_L5_argtuple_error;
5241 kw_args = PyDict_Size(__pyx_kwds);
5244 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5245 else goto __pyx_L5_argtuple_error;
5247 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
5249 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); __PYX_ERR(0, 180, __pyx_L3_error)
5252 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5254 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); __PYX_ERR(0, 180, __pyx_L3_error)
5257 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
5259 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); __PYX_ERR(0, 180, __pyx_L3_error)
5262 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5264 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); __PYX_ERR(0, 180, __pyx_L3_error)
5267 if (unlikely(kw_args > 0)) {
5268 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
5270 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
5271 goto __pyx_L5_argtuple_error;
5273 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5274 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5275 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5276 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5277 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5279 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L3_error)
5280 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5281 __pyx_v_x = ((PyArrayObject *)values[2]);
5282 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5283 __pyx_v_material_functions = ((PyObject*)values[4]);
5285 goto __pyx_L4_argument_unpacking_done;
5286 __pyx_L5_argtuple_error:;
5287 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
5289 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5290 __Pyx_RefNannyFinishContext();
5292 __pyx_L4_argument_unpacking_done:;
5293 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 181, __pyx_L1_error)
5294 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 182, __pyx_L1_error)
5295 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
5296 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 184, __pyx_L1_error)
5297 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5304 __Pyx_RefNannyFinishContext();
5308 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5311 int __pyx_v_material;
5312 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5313 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5314 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5315 __Pyx_Buffer __pyx_pybuffer_q_vals;
5316 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5317 __Pyx_Buffer __pyx_pybuffer_x;
5318 PyObject *__pyx_r = NULL;
5319 __Pyx_RefNannyDeclarations
5322 Py_ssize_t __pyx_t_3;
5325 PyObject *__pyx_t_6 = NULL;
5326 PyObject *__pyx_t_7 = NULL;
5327 PyObject *__pyx_t_8 = NULL;
5328 PyObject *__pyx_t_9 = NULL;
5329 PyObject *__pyx_t_10 = NULL;
5331 PyObject *__pyx_t_12 = NULL;
5332 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5333 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5334 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5335 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5336 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5337 __pyx_pybuffer_x.pybuffer.buf = NULL;
5338 __pyx_pybuffer_x.refcount = 0;
5339 __pyx_pybuffernd_x.data = NULL;
5340 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5341 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5342 __pyx_pybuffer_q_vals.refcount = 0;
5343 __pyx_pybuffernd_q_vals.data = NULL;
5344 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5346 __Pyx_BufFmt_StackElem __pyx_stack[1];
5347 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5349 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5351 __Pyx_BufFmt_StackElem __pyx_stack[1];
5352 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5354 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5356 __Pyx_BufFmt_StackElem __pyx_stack[1];
5357 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
5359 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5368 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5369 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5370 __pyx_v_eN = __pyx_t_2;
5379 __pyx_t_3 = __pyx_v_eN;
5381 if (__pyx_t_3 < 0) {
5382 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5383 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
5384 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
5385 if (unlikely(__pyx_t_4 != -1)) {
5386 __Pyx_RaiseBufferIndexError(__pyx_t_4);
5387 __PYX_ERR(0, 190, __pyx_L1_error)
5389 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5398 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
5399 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
5400 __pyx_v_k = __pyx_t_4;
5409 if (unlikely(__pyx_v_material_functions == Py_None)) {
5410 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5411 __PYX_ERR(0, 192, __pyx_L1_error)
5413 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error)
5414 __Pyx_GOTREF(__pyx_t_7);
5415 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5416 __Pyx_GOTREF(__pyx_t_8);
5417 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5418 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 192, __pyx_L1_error)
5419 __Pyx_GOTREF(__pyx_t_7);
5420 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5421 __Pyx_GOTREF(__pyx_t_9);
5422 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5423 __Pyx_GOTREF(__pyx_t_10);
5424 __Pyx_GIVEREF(__pyx_t_7);
5425 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
5426 __Pyx_GIVEREF(__pyx_t_9);
5427 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
5430 __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5431 __Pyx_GOTREF(__pyx_t_9);
5432 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5433 __pyx_t_10 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5434 __Pyx_GOTREF(__pyx_t_10);
5437 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5438 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
5439 if (likely(__pyx_t_7)) {
5440 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5441 __Pyx_INCREF(__pyx_t_7);
5442 __Pyx_INCREF(
function);
5443 __Pyx_DECREF_SET(__pyx_t_8,
function);
5447 #if CYTHON_FAST_PYCALL 5448 if (PyFunction_Check(__pyx_t_8)) {
5449 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_t_10};
5450 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5451 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5452 __Pyx_GOTREF(__pyx_t_6);
5453 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5454 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5457 #if CYTHON_FAST_PYCCALL 5458 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
5459 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_9, __pyx_t_10};
5460 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5461 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5462 __Pyx_GOTREF(__pyx_t_6);
5463 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5464 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5468 __pyx_t_12 = PyTuple_New(2+__pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5469 __Pyx_GOTREF(__pyx_t_12);
5471 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
5473 __Pyx_GIVEREF(__pyx_t_9);
5474 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_9);
5475 __Pyx_GIVEREF(__pyx_t_10);
5476 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
5479 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5480 __Pyx_GOTREF(__pyx_t_6);
5481 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5483 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5484 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 192, __pyx_L1_error)
5485 __Pyx_GOTREF(__pyx_t_8);
5486 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5487 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5488 __Pyx_GOTREF(__pyx_t_6);
5489 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 192, __pyx_L1_error)
5490 __Pyx_GOTREF(__pyx_t_12);
5491 __pyx_t_10 = PyTuple_New(3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 192, __pyx_L1_error)
5492 __Pyx_GOTREF(__pyx_t_10);
5493 __Pyx_GIVEREF(__pyx_t_6);
5494 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
5495 __Pyx_GIVEREF(__pyx_t_12);
5496 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
5497 __Pyx_INCREF(__pyx_slice__2);
5498 __Pyx_GIVEREF(__pyx_slice__2);
5499 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_slice__2);
5502 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_10, __pyx_t_8) < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
5503 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5504 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5517 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5520 __Pyx_XDECREF(__pyx_t_6);
5521 __Pyx_XDECREF(__pyx_t_7);
5522 __Pyx_XDECREF(__pyx_t_8);
5523 __Pyx_XDECREF(__pyx_t_9);
5524 __Pyx_XDECREF(__pyx_t_10);
5525 __Pyx_XDECREF(__pyx_t_12);
5526 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5527 __Pyx_PyThreadState_declare
5528 __Pyx_PyThreadState_assign
5529 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5530 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5531 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5532 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5533 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5534 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5538 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5539 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5540 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5542 __Pyx_XGIVEREF(__pyx_r);
5543 __Pyx_RefNannyFinishContext();
5556 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5557 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5558 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5559 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5561 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5562 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5563 PyArrayObject *__pyx_v_x = 0;
5564 PyArrayObject *__pyx_v_ebq_vals = 0;
5565 PyObject *__pyx_v_material_functions = 0;
5566 PyObject *__pyx_r = 0;
5567 __Pyx_RefNannyDeclarations
5568 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5570 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5571 PyObject* values[6] = {0,0,0,0,0,0};
5572 if (unlikely(__pyx_kwds)) {
5574 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5576 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5577 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5578 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5579 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5580 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5581 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5583 default:
goto __pyx_L5_argtuple_error;
5585 kw_args = PyDict_Size(__pyx_kwds);
5588 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5589 else goto __pyx_L5_argtuple_error;
5591 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
5593 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 195, __pyx_L3_error)
5596 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
5598 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 195, __pyx_L3_error)
5601 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5603 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 195, __pyx_L3_error)
5606 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
5608 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 195, __pyx_L3_error)
5611 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5613 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 195, __pyx_L3_error)
5616 if (unlikely(kw_args > 0)) {
5617 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
5619 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5620 goto __pyx_L5_argtuple_error;
5622 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5623 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5624 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5625 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5626 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5627 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5629 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
5630 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
5631 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
5632 __pyx_v_x = ((PyArrayObject *)values[3]);
5633 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
5634 __pyx_v_material_functions = ((PyObject*)values[5]);
5636 goto __pyx_L4_argument_unpacking_done;
5637 __pyx_L5_argtuple_error:;
5638 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
5640 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5641 __Pyx_RefNannyFinishContext();
5643 __pyx_L4_argument_unpacking_done:;
5644 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 196, __pyx_L1_error)
5645 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 197, __pyx_L1_error)
5646 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 198, __pyx_L1_error)
5647 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 199, __pyx_L1_error)
5648 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 200, __pyx_L1_error)
5649 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
5656 __Pyx_RefNannyFinishContext();
5660 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
5663 int __pyx_v_ebN_local;
5665 int __pyx_v_material_left;
5666 int __pyx_v_material_right;
5667 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
5668 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
5669 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
5670 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
5671 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
5672 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
5673 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5674 __Pyx_Buffer __pyx_pybuffer_x;
5675 PyObject *__pyx_r = NULL;
5676 __Pyx_RefNannyDeclarations
5681 Py_ssize_t __pyx_t_5;
5682 Py_ssize_t __pyx_t_6;
5684 Py_ssize_t __pyx_t_8;
5685 Py_ssize_t __pyx_t_9;
5686 Py_ssize_t __pyx_t_10;
5687 Py_ssize_t __pyx_t_11;
5688 npy_intp __pyx_t_12;
5689 PyObject *__pyx_t_13 = NULL;
5690 PyObject *__pyx_t_14 = NULL;
5691 PyObject *__pyx_t_15 = NULL;
5692 PyObject *__pyx_t_16 = NULL;
5693 PyObject *__pyx_t_17 = NULL;
5694 PyObject *__pyx_t_18 = NULL;
5696 PyObject *__pyx_t_20 = NULL;
5697 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_21;
5698 Py_ssize_t __pyx_t_22;
5699 Py_ssize_t __pyx_t_23;
5700 Py_ssize_t __pyx_t_24;
5701 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
5702 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
5703 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
5704 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
5705 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
5706 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
5707 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
5708 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
5709 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
5710 __pyx_pybuffer_x.pybuffer.buf = NULL;
5711 __pyx_pybuffer_x.refcount = 0;
5712 __pyx_pybuffernd_x.data = NULL;
5713 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5714 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
5715 __pyx_pybuffer_ebq_vals.refcount = 0;
5716 __pyx_pybuffernd_ebq_vals.data = NULL;
5717 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
5719 __Pyx_BufFmt_StackElem __pyx_stack[1];
5720 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
5722 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
5724 __Pyx_BufFmt_StackElem __pyx_stack[1];
5725 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
5727 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
5729 __Pyx_BufFmt_StackElem __pyx_stack[1];
5730 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
5732 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
5734 __Pyx_BufFmt_StackElem __pyx_stack[1];
5735 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
5737 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
5746 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5747 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5748 __pyx_v_eN = __pyx_t_2;
5757 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
5758 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5759 __pyx_v_ebN_local = __pyx_t_4;
5768 __pyx_t_5 = __pyx_v_eN;
5769 __pyx_t_6 = __pyx_v_ebN_local;
5771 if (__pyx_t_5 < 0) {
5772 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
5773 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
5774 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
5775 if (__pyx_t_6 < 0) {
5776 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
5777 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
5778 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
5779 if (unlikely(__pyx_t_7 != -1)) {
5780 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5781 __PYX_ERR(0, 212, __pyx_L1_error)
5783 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
5792 __pyx_t_8 = __pyx_v_ebN;
5795 if (__pyx_t_8 < 0) {
5796 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5797 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
5798 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
5799 if (__pyx_t_9 < 0) {
5800 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5801 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
5802 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
5803 if (unlikely(__pyx_t_7 != -1)) {
5804 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5805 __PYX_ERR(0, 213, __pyx_L1_error)
5807 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5816 __pyx_t_10 = __pyx_v_ebN;
5819 if (__pyx_t_10 < 0) {
5820 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5821 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
5822 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
5823 if (__pyx_t_11 < 0) {
5824 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5825 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
5826 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
5827 if (unlikely(__pyx_t_7 != -1)) {
5828 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5829 __PYX_ERR(0, 214, __pyx_L1_error)
5831 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5840 __pyx_t_12 = (__pyx_v_x->dimensions[2]);
5841 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
5842 __pyx_v_k = __pyx_t_7;
5851 if (unlikely(__pyx_v_material_functions == Py_None)) {
5852 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5853 __PYX_ERR(0, 216, __pyx_L1_error)
5855 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
5856 __Pyx_GOTREF(__pyx_t_14);
5857 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 216, __pyx_L1_error)
5858 __Pyx_GOTREF(__pyx_t_15);
5859 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5860 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
5861 __Pyx_GOTREF(__pyx_t_14);
5862 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 216, __pyx_L1_error)
5863 __Pyx_GOTREF(__pyx_t_16);
5864 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
5865 __Pyx_GOTREF(__pyx_t_17);
5866 __pyx_t_18 = PyTuple_New(3);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
5867 __Pyx_GOTREF(__pyx_t_18);
5868 __Pyx_GIVEREF(__pyx_t_14);
5869 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_14);
5870 __Pyx_GIVEREF(__pyx_t_16);
5871 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_16);
5872 __Pyx_GIVEREF(__pyx_t_17);
5873 PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_17);
5877 __pyx_t_17 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 216, __pyx_L1_error)
5878 __Pyx_GOTREF(__pyx_t_17);
5879 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5880 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
5881 __Pyx_GOTREF(__pyx_t_18);
5884 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
5885 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
5886 if (likely(__pyx_t_16)) {
5887 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
5888 __Pyx_INCREF(__pyx_t_16);
5889 __Pyx_INCREF(
function);
5890 __Pyx_DECREF_SET(__pyx_t_15,
function);
5894 #if CYTHON_FAST_PYCALL 5895 if (PyFunction_Check(__pyx_t_15)) {
5896 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_17, __pyx_t_18};
5897 __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
5898 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
5899 __Pyx_GOTREF(__pyx_t_13);
5900 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5901 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5904 #if CYTHON_FAST_PYCCALL 5905 if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
5906 PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_t_17, __pyx_t_18};
5907 __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
5908 __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
5909 __Pyx_GOTREF(__pyx_t_13);
5910 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
5911 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5915 __pyx_t_14 = PyTuple_New(2+__pyx_t_19);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 216, __pyx_L1_error)
5916 __Pyx_GOTREF(__pyx_t_14);
5918 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL;
5920 __Pyx_GIVEREF(__pyx_t_17);
5921 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_19, __pyx_t_17);
5922 __Pyx_GIVEREF(__pyx_t_18);
5923 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_19, __pyx_t_18);
5926 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 216, __pyx_L1_error)
5927 __Pyx_GOTREF(__pyx_t_13);
5928 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5930 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5939 if (unlikely(__pyx_v_material_functions == Py_None)) {
5940 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5941 __PYX_ERR(0, 217, __pyx_L1_error)
5943 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
5944 __Pyx_GOTREF(__pyx_t_14);
5945 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 217, __pyx_L1_error)
5946 __Pyx_GOTREF(__pyx_t_18);
5947 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5948 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
5949 __Pyx_GOTREF(__pyx_t_14);
5950 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 217, __pyx_L1_error)
5951 __Pyx_GOTREF(__pyx_t_17);
5952 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
5953 __Pyx_GOTREF(__pyx_t_16);
5954 __pyx_t_20 = PyTuple_New(3);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 217, __pyx_L1_error)
5955 __Pyx_GOTREF(__pyx_t_20);
5956 __Pyx_GIVEREF(__pyx_t_14);
5957 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_14);
5958 __Pyx_GIVEREF(__pyx_t_17);
5959 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_17);
5960 __Pyx_GIVEREF(__pyx_t_16);
5961 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_16);
5965 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 217, __pyx_L1_error)
5966 __Pyx_GOTREF(__pyx_t_16);
5967 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5968 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 217, __pyx_L1_error)
5969 __Pyx_GOTREF(__pyx_t_20);
5972 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_18))) {
5973 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18);
5974 if (likely(__pyx_t_17)) {
5975 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_18);
5976 __Pyx_INCREF(__pyx_t_17);
5977 __Pyx_INCREF(
function);
5978 __Pyx_DECREF_SET(__pyx_t_18,
function);
5982 #if CYTHON_FAST_PYCALL 5983 if (PyFunction_Check(__pyx_t_18)) {
5984 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_16, __pyx_t_20};
5985 __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
5986 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5987 __Pyx_GOTREF(__pyx_t_15);
5988 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5989 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5992 #if CYTHON_FAST_PYCCALL 5993 if (__Pyx_PyFastCFunction_Check(__pyx_t_18)) {
5994 PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_t_16, __pyx_t_20};
5995 __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_18, __pyx_temp+1-__pyx_t_19, 2+__pyx_t_19);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
5996 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
5997 __Pyx_GOTREF(__pyx_t_15);
5998 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
5999 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6003 __pyx_t_14 = PyTuple_New(2+__pyx_t_19);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 217, __pyx_L1_error)
6004 __Pyx_GOTREF(__pyx_t_14);
6006 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17); __pyx_t_17 = NULL;
6008 __Pyx_GIVEREF(__pyx_t_16);
6009 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_19, __pyx_t_16);
6010 __Pyx_GIVEREF(__pyx_t_20);
6011 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_19, __pyx_t_20);
6014 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 217, __pyx_L1_error)
6015 __Pyx_GOTREF(__pyx_t_15);
6016 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6018 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6027 __pyx_t_18 = PyNumber_Add(__pyx_t_13, __pyx_t_15);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 216, __pyx_L1_error)
6028 __Pyx_GOTREF(__pyx_t_18);
6029 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
6030 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6031 __pyx_t_15 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_18);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 216, __pyx_L1_error)
6032 __Pyx_GOTREF(__pyx_t_15);
6033 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6034 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_21 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
6035 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
6036 __pyx_t_22 = __pyx_v_eN;
6037 __pyx_t_23 = __pyx_v_ebN_local;
6038 __pyx_t_24 = __pyx_v_k;
6040 if (__pyx_t_22 < 0) {
6041 __pyx_t_22 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6042 if (unlikely(__pyx_t_22 < 0)) __pyx_t_19 = 0;
6043 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_19 = 0;
6044 if (__pyx_t_23 < 0) {
6045 __pyx_t_23 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6046 if (unlikely(__pyx_t_23 < 0)) __pyx_t_19 = 1;
6047 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_19 = 1;
6048 if (__pyx_t_24 < 0) {
6049 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6050 if (unlikely(__pyx_t_24 < 0)) __pyx_t_19 = 2;
6051 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_19 = 2;
6052 if (unlikely(__pyx_t_19 != -1)) {
6053 __Pyx_RaiseBufferIndexError(__pyx_t_19);
6054 __PYX_ERR(0, 216, __pyx_L1_error)
6056 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_21;
6070 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6073 __Pyx_XDECREF(__pyx_t_13);
6074 __Pyx_XDECREF(__pyx_t_14);
6075 __Pyx_XDECREF(__pyx_t_15);
6076 __Pyx_XDECREF(__pyx_t_16);
6077 __Pyx_XDECREF(__pyx_t_17);
6078 __Pyx_XDECREF(__pyx_t_18);
6079 __Pyx_XDECREF(__pyx_t_20);
6080 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6081 __Pyx_PyThreadState_declare
6082 __Pyx_PyThreadState_assign
6083 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6084 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6085 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6086 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6087 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6088 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6089 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6093 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6094 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6095 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6096 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6098 __Pyx_XGIVEREF(__pyx_r);
6099 __Pyx_RefNannyFinishContext();
6112 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6113 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6114 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
6115 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6118 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6119 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6120 PyArrayObject *__pyx_v_x = 0;
6121 PyArrayObject *__pyx_v_ebq_vals = 0;
6122 PyObject *__pyx_v_material_functions = 0;
6123 PyObject *__pyx_r = 0;
6124 __Pyx_RefNannyDeclarations
6125 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
6127 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
6128 PyObject* values[7] = {0,0,0,0,0,0,0};
6129 if (unlikely(__pyx_kwds)) {
6131 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6133 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6134 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6135 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6136 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6137 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6138 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6139 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6141 default:
goto __pyx_L5_argtuple_error;
6143 kw_args = PyDict_Size(__pyx_kwds);
6146 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
6147 else goto __pyx_L5_argtuple_error;
6149 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6151 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 219, __pyx_L3_error)
6154 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6156 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 219, __pyx_L3_error)
6159 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6161 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 219, __pyx_L3_error)
6164 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6166 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 219, __pyx_L3_error)
6169 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
6171 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 219, __pyx_L3_error)
6174 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6176 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 219, __pyx_L3_error)
6179 if (unlikely(kw_args > 0)) {
6180 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 219, __pyx_L3_error)
6182 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
6183 goto __pyx_L5_argtuple_error;
6185 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6186 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6187 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6188 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6189 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6190 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6191 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6193 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L3_error)
6194 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L3_error)
6195 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
6196 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
6197 __pyx_v_x = ((PyArrayObject *)values[4]);
6198 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
6199 __pyx_v_material_functions = ((PyObject*)values[6]);
6201 goto __pyx_L4_argument_unpacking_done;
6202 __pyx_L5_argtuple_error:;
6203 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 219, __pyx_L3_error)
6205 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6206 __Pyx_RefNannyFinishContext();
6208 __pyx_L4_argument_unpacking_done:;
6209 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 221, __pyx_L1_error)
6210 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6211 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
6212 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6213 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 225, __pyx_L1_error)
6214 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
6221 __Pyx_RefNannyFinishContext();
6225 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
6228 int __pyx_v_ebN_local;
6230 int __pyx_v_material_left;
6231 int __pyx_v_material_right;
6234 double __pyx_v_numer;
6235 double __pyx_v_denom;
6236 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
6237 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
6238 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6239 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6240 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6241 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6242 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6243 __Pyx_Buffer __pyx_pybuffer_x;
6244 PyObject *__pyx_r = NULL;
6245 __Pyx_RefNannyDeclarations
6250 Py_ssize_t __pyx_t_5;
6251 Py_ssize_t __pyx_t_6;
6253 Py_ssize_t __pyx_t_8;
6254 Py_ssize_t __pyx_t_9;
6255 Py_ssize_t __pyx_t_10;
6256 Py_ssize_t __pyx_t_11;
6257 npy_intp __pyx_t_12;
6262 PyObject *__pyx_t_17 = NULL;
6263 PyObject *__pyx_t_18 = NULL;
6264 PyObject *__pyx_t_19 = NULL;
6265 PyObject *__pyx_t_20 = NULL;
6266 PyObject *__pyx_t_21 = NULL;
6267 PyObject *__pyx_t_22 = NULL;
6269 PyObject *__pyx_t_24 = NULL;
6271 Py_ssize_t __pyx_t_26;
6272 Py_ssize_t __pyx_t_27;
6273 Py_ssize_t __pyx_t_28;
6274 Py_ssize_t __pyx_t_29;
6275 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
6276 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6277 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6278 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6279 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6280 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6281 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6282 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6283 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6284 __pyx_pybuffer_x.pybuffer.buf = NULL;
6285 __pyx_pybuffer_x.refcount = 0;
6286 __pyx_pybuffernd_x.data = NULL;
6287 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6288 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
6289 __pyx_pybuffer_ebq_vals.refcount = 0;
6290 __pyx_pybuffernd_ebq_vals.data = NULL;
6291 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
6293 __Pyx_BufFmt_StackElem __pyx_stack[1];
6294 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6296 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6298 __Pyx_BufFmt_StackElem __pyx_stack[1];
6299 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6301 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6303 __Pyx_BufFmt_StackElem __pyx_stack[1];
6304 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6306 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
6308 __Pyx_BufFmt_StackElem __pyx_stack[1];
6309 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
6311 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
6320 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6321 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
6322 __pyx_v_eN = __pyx_t_2;
6331 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
6332 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6333 __pyx_v_ebN_local = __pyx_t_4;
6342 __pyx_t_5 = __pyx_v_eN;
6343 __pyx_t_6 = __pyx_v_ebN_local;
6345 if (__pyx_t_5 < 0) {
6346 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6347 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
6348 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
6349 if (__pyx_t_6 < 0) {
6350 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6351 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
6352 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
6353 if (unlikely(__pyx_t_7 != -1)) {
6354 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6355 __PYX_ERR(0, 238, __pyx_L1_error)
6357 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6366 __pyx_t_8 = __pyx_v_ebN;
6369 if (__pyx_t_8 < 0) {
6370 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6371 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
6372 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
6373 if (__pyx_t_9 < 0) {
6374 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6375 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
6376 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
6377 if (unlikely(__pyx_t_7 != -1)) {
6378 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6379 __PYX_ERR(0, 239, __pyx_L1_error)
6381 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6390 __pyx_t_10 = __pyx_v_ebN;
6393 if (__pyx_t_10 < 0) {
6394 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6395 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
6396 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
6397 if (__pyx_t_11 < 0) {
6398 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6399 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
6400 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
6401 if (unlikely(__pyx_t_7 != -1)) {
6402 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6403 __PYX_ERR(0, 240, __pyx_L1_error)
6405 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6414 __pyx_t_12 = (__pyx_v_x->dimensions[2]);
6415 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
6416 __pyx_v_k = __pyx_t_7;
6425 __pyx_t_13 = __pyx_v_nd;
6426 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6427 __pyx_v_I = __pyx_t_14;
6436 __pyx_t_15 = __pyx_v_nd;
6437 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
6438 __pyx_v_J = __pyx_t_16;
6447 if (unlikely(__pyx_v_material_functions == Py_None)) {
6448 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6449 __PYX_ERR(0, 244, __pyx_L1_error)
6451 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6452 __Pyx_GOTREF(__pyx_t_18);
6453 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6454 __Pyx_GOTREF(__pyx_t_19);
6455 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6456 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6457 __Pyx_GOTREF(__pyx_t_18);
6458 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6459 __Pyx_GOTREF(__pyx_t_20);
6460 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
6461 __Pyx_GOTREF(__pyx_t_21);
6462 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6463 __Pyx_GOTREF(__pyx_t_22);
6464 __Pyx_GIVEREF(__pyx_t_18);
6465 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_18);
6466 __Pyx_GIVEREF(__pyx_t_20);
6467 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
6468 __Pyx_GIVEREF(__pyx_t_21);
6469 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21);
6473 __pyx_t_21 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
6474 __Pyx_GOTREF(__pyx_t_21);
6475 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6476 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6477 __Pyx_GOTREF(__pyx_t_22);
6480 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6481 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
6482 if (likely(__pyx_t_20)) {
6483 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
6484 __Pyx_INCREF(__pyx_t_20);
6485 __Pyx_INCREF(
function);
6486 __Pyx_DECREF_SET(__pyx_t_19,
function);
6490 #if CYTHON_FAST_PYCALL 6491 if (PyFunction_Check(__pyx_t_19)) {
6492 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_21, __pyx_t_22};
6493 __pyx_t_17 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6494 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6495 __Pyx_GOTREF(__pyx_t_17);
6496 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6497 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6500 #if CYTHON_FAST_PYCCALL 6501 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
6502 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_21, __pyx_t_22};
6503 __pyx_t_17 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6504 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6505 __Pyx_GOTREF(__pyx_t_17);
6506 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6507 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6511 __pyx_t_18 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6512 __Pyx_GOTREF(__pyx_t_18);
6514 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20); __pyx_t_20 = NULL;
6516 __Pyx_GIVEREF(__pyx_t_21);
6517 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_23, __pyx_t_21);
6518 __Pyx_GIVEREF(__pyx_t_22);
6519 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_23, __pyx_t_22);
6522 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6523 __Pyx_GOTREF(__pyx_t_17);
6524 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6526 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6527 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6528 __Pyx_GOTREF(__pyx_t_19);
6529 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6530 __Pyx_GOTREF(__pyx_t_18);
6531 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6532 __Pyx_GOTREF(__pyx_t_22);
6533 __Pyx_GIVEREF(__pyx_t_19);
6534 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19);
6535 __Pyx_GIVEREF(__pyx_t_18);
6536 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18);
6539 __pyx_t_18 = PyObject_GetItem(__pyx_t_17, __pyx_t_22);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6540 __Pyx_GOTREF(__pyx_t_18);
6541 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6542 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6543 __pyx_t_22 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_18);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 244, __pyx_L1_error)
6544 __Pyx_GOTREF(__pyx_t_22);
6545 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6546 if (unlikely(__pyx_v_material_functions == Py_None)) {
6547 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6548 __PYX_ERR(0, 244, __pyx_L1_error)
6550 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6551 __Pyx_GOTREF(__pyx_t_17);
6552 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6553 __Pyx_GOTREF(__pyx_t_19);
6554 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6555 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6556 __Pyx_GOTREF(__pyx_t_17);
6557 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 244, __pyx_L1_error)
6558 __Pyx_GOTREF(__pyx_t_21);
6559 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6560 __Pyx_GOTREF(__pyx_t_20);
6561 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6562 __Pyx_GOTREF(__pyx_t_24);
6563 __Pyx_GIVEREF(__pyx_t_17);
6564 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_17);
6565 __Pyx_GIVEREF(__pyx_t_21);
6566 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_21);
6567 __Pyx_GIVEREF(__pyx_t_20);
6568 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_20);
6572 __pyx_t_20 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_24);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 244, __pyx_L1_error)
6573 __Pyx_GOTREF(__pyx_t_20);
6574 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6575 __pyx_t_24 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6576 __Pyx_GOTREF(__pyx_t_24);
6579 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
6580 __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_19);
6581 if (likely(__pyx_t_21)) {
6582 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
6583 __Pyx_INCREF(__pyx_t_21);
6584 __Pyx_INCREF(
function);
6585 __Pyx_DECREF_SET(__pyx_t_19,
function);
6589 #if CYTHON_FAST_PYCALL 6590 if (PyFunction_Check(__pyx_t_19)) {
6591 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_20, __pyx_t_24};
6592 __pyx_t_18 = __Pyx_PyFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6593 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6594 __Pyx_GOTREF(__pyx_t_18);
6595 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6596 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6599 #if CYTHON_FAST_PYCCALL 6600 if (__Pyx_PyFastCFunction_Check(__pyx_t_19)) {
6601 PyObject *__pyx_temp[3] = {__pyx_t_21, __pyx_t_20, __pyx_t_24};
6602 __pyx_t_18 = __Pyx_PyCFunction_FastCall(__pyx_t_19, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6603 __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
6604 __Pyx_GOTREF(__pyx_t_18);
6605 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6606 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6610 __pyx_t_17 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6611 __Pyx_GOTREF(__pyx_t_17);
6613 __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_21); __pyx_t_21 = NULL;
6615 __Pyx_GIVEREF(__pyx_t_20);
6616 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_23, __pyx_t_20);
6617 __Pyx_GIVEREF(__pyx_t_24);
6618 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_23, __pyx_t_24);
6621 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 244, __pyx_L1_error)
6622 __Pyx_GOTREF(__pyx_t_18);
6623 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6625 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6626 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 244, __pyx_L1_error)
6627 __Pyx_GOTREF(__pyx_t_19);
6628 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_17);
6630 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6631 __Pyx_GOTREF(__pyx_t_24);
6632 __Pyx_GIVEREF(__pyx_t_19);
6633 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_19);
6634 __Pyx_GIVEREF(__pyx_t_17);
6635 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_17);
6638 __pyx_t_17 = PyObject_GetItem(__pyx_t_18, __pyx_t_24);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 244, __pyx_L1_error)
6639 __Pyx_GOTREF(__pyx_t_17);
6640 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6641 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6642 __pyx_t_24 = PyNumber_Multiply(__pyx_t_22, __pyx_t_17);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 244, __pyx_L1_error)
6643 __Pyx_GOTREF(__pyx_t_24);
6644 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6645 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6646 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_24);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L1_error)
6647 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6648 __pyx_v_numer = __pyx_t_25;
6657 if (unlikely(__pyx_v_material_functions == Py_None)) {
6658 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6659 __PYX_ERR(0, 245, __pyx_L1_error)
6661 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 245, __pyx_L1_error)
6662 __Pyx_GOTREF(__pyx_t_17);
6663 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
6664 __Pyx_GOTREF(__pyx_t_22);
6665 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6666 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 245, __pyx_L1_error)
6667 __Pyx_GOTREF(__pyx_t_17);
6668 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
6669 __Pyx_GOTREF(__pyx_t_18);
6670 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
6671 __Pyx_GOTREF(__pyx_t_19);
6672 __pyx_t_20 = PyTuple_New(3);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6673 __Pyx_GOTREF(__pyx_t_20);
6674 __Pyx_GIVEREF(__pyx_t_17);
6675 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
6676 __Pyx_GIVEREF(__pyx_t_18);
6677 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_18);
6678 __Pyx_GIVEREF(__pyx_t_19);
6679 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_19);
6683 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
6684 __Pyx_GOTREF(__pyx_t_19);
6685 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6686 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6687 __Pyx_GOTREF(__pyx_t_20);
6690 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) {
6691 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_22);
6692 if (likely(__pyx_t_18)) {
6693 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_22);
6694 __Pyx_INCREF(__pyx_t_18);
6695 __Pyx_INCREF(
function);
6696 __Pyx_DECREF_SET(__pyx_t_22,
function);
6700 #if CYTHON_FAST_PYCALL 6701 if (PyFunction_Check(__pyx_t_22)) {
6702 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_19, __pyx_t_20};
6703 __pyx_t_24 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6704 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6705 __Pyx_GOTREF(__pyx_t_24);
6706 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6707 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6710 #if CYTHON_FAST_PYCCALL 6711 if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) {
6712 PyObject *__pyx_temp[3] = {__pyx_t_18, __pyx_t_19, __pyx_t_20};
6713 __pyx_t_24 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6714 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
6715 __Pyx_GOTREF(__pyx_t_24);
6716 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6717 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6721 __pyx_t_17 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 245, __pyx_L1_error)
6722 __Pyx_GOTREF(__pyx_t_17);
6724 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __pyx_t_18 = NULL;
6726 __Pyx_GIVEREF(__pyx_t_19);
6727 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_23, __pyx_t_19);
6728 __Pyx_GIVEREF(__pyx_t_20);
6729 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_23, __pyx_t_20);
6732 __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6733 __Pyx_GOTREF(__pyx_t_24);
6734 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6736 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6737 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
6738 __Pyx_GOTREF(__pyx_t_22);
6739 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 245, __pyx_L1_error)
6740 __Pyx_GOTREF(__pyx_t_17);
6741 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6742 __Pyx_GOTREF(__pyx_t_20);
6743 __Pyx_GIVEREF(__pyx_t_22);
6744 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_22);
6745 __Pyx_GIVEREF(__pyx_t_17);
6746 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_17);
6749 __pyx_t_17 = PyObject_GetItem(__pyx_t_24, __pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 245, __pyx_L1_error)
6750 __Pyx_GOTREF(__pyx_t_17);
6751 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6752 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6753 if (unlikely(__pyx_v_material_functions == Py_None)) {
6754 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6755 __PYX_ERR(0, 245, __pyx_L1_error)
6757 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6758 __Pyx_GOTREF(__pyx_t_24);
6759 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
6760 __Pyx_GOTREF(__pyx_t_22);
6761 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6762 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6763 __Pyx_GOTREF(__pyx_t_24);
6764 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 245, __pyx_L1_error)
6765 __Pyx_GOTREF(__pyx_t_19);
6766 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
6767 __Pyx_GOTREF(__pyx_t_18);
6768 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
6769 __Pyx_GOTREF(__pyx_t_21);
6770 __Pyx_GIVEREF(__pyx_t_24);
6771 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_24);
6772 __Pyx_GIVEREF(__pyx_t_19);
6773 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
6774 __Pyx_GIVEREF(__pyx_t_18);
6775 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_18);
6779 __pyx_t_18 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 245, __pyx_L1_error)
6780 __Pyx_GOTREF(__pyx_t_18);
6781 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6782 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
6783 __Pyx_GOTREF(__pyx_t_21);
6786 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_22))) {
6787 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_22);
6788 if (likely(__pyx_t_19)) {
6789 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_22);
6790 __Pyx_INCREF(__pyx_t_19);
6791 __Pyx_INCREF(
function);
6792 __Pyx_DECREF_SET(__pyx_t_22,
function);
6796 #if CYTHON_FAST_PYCALL 6797 if (PyFunction_Check(__pyx_t_22)) {
6798 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_18, __pyx_t_21};
6799 __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6800 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6801 __Pyx_GOTREF(__pyx_t_20);
6802 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6803 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6806 #if CYTHON_FAST_PYCCALL 6807 if (__Pyx_PyFastCFunction_Check(__pyx_t_22)) {
6808 PyObject *__pyx_temp[3] = {__pyx_t_19, __pyx_t_18, __pyx_t_21};
6809 __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_22, __pyx_temp+1-__pyx_t_23, 2+__pyx_t_23);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6810 __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
6811 __Pyx_GOTREF(__pyx_t_20);
6812 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6813 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6817 __pyx_t_24 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6818 __Pyx_GOTREF(__pyx_t_24);
6820 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_19); __pyx_t_19 = NULL;
6822 __Pyx_GIVEREF(__pyx_t_18);
6823 PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_23, __pyx_t_18);
6824 __Pyx_GIVEREF(__pyx_t_21);
6825 PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_23, __pyx_t_21);
6828 __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_24, NULL);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 245, __pyx_L1_error)
6829 __Pyx_GOTREF(__pyx_t_20);
6830 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6832 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6833 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 245, __pyx_L1_error)
6834 __Pyx_GOTREF(__pyx_t_22);
6835 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6836 __Pyx_GOTREF(__pyx_t_24);
6837 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
6838 __Pyx_GOTREF(__pyx_t_21);
6839 __Pyx_GIVEREF(__pyx_t_22);
6840 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22);
6841 __Pyx_GIVEREF(__pyx_t_24);
6842 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_24);
6845 __pyx_t_24 = PyObject_GetItem(__pyx_t_20, __pyx_t_21);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6846 __Pyx_GOTREF(__pyx_t_24);
6847 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6848 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6849 __pyx_t_21 = PyNumber_Add(__pyx_t_17, __pyx_t_24);
if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 245, __pyx_L1_error)
6850 __Pyx_GOTREF(__pyx_t_21);
6851 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6852 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6853 __pyx_t_24 = __Pyx_PyFloat_AddObjC(__pyx_t_21, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 245, __pyx_L1_error)
6854 __Pyx_GOTREF(__pyx_t_24);
6855 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6856 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_24);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
6857 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6858 __pyx_v_denom = __pyx_t_25;
6867 if (unlikely(__pyx_v_denom == 0)) {
6868 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
6869 __PYX_ERR(0, 246, __pyx_L1_error)
6871 __pyx_t_26 = __pyx_v_eN;
6872 __pyx_t_27 = __pyx_v_ebN_local;
6873 __pyx_t_28 = __pyx_v_k;
6874 __pyx_t_29 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
6876 if (__pyx_t_26 < 0) {
6877 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6878 if (unlikely(__pyx_t_26 < 0)) __pyx_t_23 = 0;
6879 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_23 = 0;
6880 if (__pyx_t_27 < 0) {
6881 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6882 if (unlikely(__pyx_t_27 < 0)) __pyx_t_23 = 1;
6883 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_23 = 1;
6884 if (__pyx_t_28 < 0) {
6885 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6886 if (unlikely(__pyx_t_28 < 0)) __pyx_t_23 = 2;
6887 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_23 = 2;
6888 if (__pyx_t_29 < 0) {
6889 __pyx_t_29 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
6890 if (unlikely(__pyx_t_29 < 0)) __pyx_t_23 = 3;
6891 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_23 = 3;
6892 if (unlikely(__pyx_t_23 != -1)) {
6893 __Pyx_RaiseBufferIndexError(__pyx_t_23);
6894 __PYX_ERR(0, 246, __pyx_L1_error)
6896 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_29, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
6912 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6915 __Pyx_XDECREF(__pyx_t_17);
6916 __Pyx_XDECREF(__pyx_t_18);
6917 __Pyx_XDECREF(__pyx_t_19);
6918 __Pyx_XDECREF(__pyx_t_20);
6919 __Pyx_XDECREF(__pyx_t_21);
6920 __Pyx_XDECREF(__pyx_t_22);
6921 __Pyx_XDECREF(__pyx_t_24);
6922 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6923 __Pyx_PyThreadState_declare
6924 __Pyx_PyThreadState_assign
6925 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6926 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6927 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6928 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6929 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6930 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6931 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6935 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6936 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6937 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6938 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6940 __Pyx_XGIVEREF(__pyx_r);
6941 __Pyx_RefNannyFinishContext();
6954 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6955 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6956 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
6957 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6959 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6960 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6961 PyArrayObject *__pyx_v_x = 0;
6962 PyArrayObject *__pyx_v_ebq_global_vals = 0;
6963 PyObject *__pyx_v_material_functions = 0;
6964 PyObject *__pyx_r = 0;
6965 __Pyx_RefNannyDeclarations
6966 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
6968 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
6969 PyObject* values[6] = {0,0,0,0,0,0};
6970 if (unlikely(__pyx_kwds)) {
6972 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6974 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6975 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6976 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6977 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6978 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6979 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6981 default:
goto __pyx_L5_argtuple_error;
6983 kw_args = PyDict_Size(__pyx_kwds);
6986 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6987 else goto __pyx_L5_argtuple_error;
6989 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6991 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); __PYX_ERR(0, 248, __pyx_L3_error)
6994 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6996 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); __PYX_ERR(0, 248, __pyx_L3_error)
6999 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7001 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); __PYX_ERR(0, 248, __pyx_L3_error)
7004 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7006 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); __PYX_ERR(0, 248, __pyx_L3_error)
7009 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7011 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); __PYX_ERR(0, 248, __pyx_L3_error)
7014 if (unlikely(kw_args > 0)) {
7015 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
7017 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7018 goto __pyx_L5_argtuple_error;
7020 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7021 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7022 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7023 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7024 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7025 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7027 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L3_error)
7028 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
7029 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
7030 __pyx_v_x = ((PyArrayObject *)values[3]);
7031 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
7032 __pyx_v_material_functions = ((PyObject*)values[5]);
7034 goto __pyx_L4_argument_unpacking_done;
7035 __pyx_L5_argtuple_error:;
7036 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
7038 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7039 __Pyx_RefNannyFinishContext();
7041 __pyx_L4_argument_unpacking_done:;
7042 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 249, __pyx_L1_error)
7043 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 250, __pyx_L1_error)
7044 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 251, __pyx_L1_error)
7045 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 252, __pyx_L1_error)
7046 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 253, __pyx_L1_error)
7047 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7054 __Pyx_RefNannyFinishContext();
7058 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7060 int __pyx_v_material_left;
7061 int __pyx_v_material_right;
7063 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7064 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7065 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7066 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7067 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7068 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7069 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7070 __Pyx_Buffer __pyx_pybuffer_x;
7071 PyObject *__pyx_r = NULL;
7072 __Pyx_RefNannyDeclarations
7075 Py_ssize_t __pyx_t_3;
7076 Py_ssize_t __pyx_t_4;
7078 Py_ssize_t __pyx_t_6;
7079 Py_ssize_t __pyx_t_7;
7082 PyObject *__pyx_t_10 = NULL;
7083 PyObject *__pyx_t_11 = NULL;
7084 PyObject *__pyx_t_12 = NULL;
7085 PyObject *__pyx_t_13 = NULL;
7086 PyObject *__pyx_t_14 = NULL;
7087 PyObject *__pyx_t_15 = NULL;
7088 PyObject *__pyx_t_16 = NULL;
7089 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
7090 Py_ssize_t __pyx_t_18;
7091 Py_ssize_t __pyx_t_19;
7092 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
7093 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7094 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7095 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7096 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7097 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7098 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7099 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7100 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7101 __pyx_pybuffer_x.pybuffer.buf = NULL;
7102 __pyx_pybuffer_x.refcount = 0;
7103 __pyx_pybuffernd_x.data = NULL;
7104 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7105 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7106 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7107 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7108 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7110 __Pyx_BufFmt_StackElem __pyx_stack[1];
7111 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7113 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7115 __Pyx_BufFmt_StackElem __pyx_stack[1];
7116 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7118 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7120 __Pyx_BufFmt_StackElem __pyx_stack[1];
7121 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7123 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
7125 __Pyx_BufFmt_StackElem __pyx_stack[1];
7126 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
7128 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
7137 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7138 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
7139 __pyx_v_ebN = __pyx_t_2;
7148 __pyx_t_3 = __pyx_v_ebN;
7151 if (__pyx_t_3 < 0) {
7152 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7153 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
7154 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7155 if (__pyx_t_4 < 0) {
7156 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7157 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
7158 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7159 if (unlikely(__pyx_t_5 != -1)) {
7160 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7161 __PYX_ERR(0, 264, __pyx_L1_error)
7163 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7172 __pyx_t_6 = __pyx_v_ebN;
7175 if (__pyx_t_6 < 0) {
7176 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7177 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
7178 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7179 if (__pyx_t_7 < 0) {
7180 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7181 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
7182 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7183 if (unlikely(__pyx_t_5 != -1)) {
7184 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7185 __PYX_ERR(0, 265, __pyx_L1_error)
7187 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7196 __pyx_t_8 = (__pyx_v_x->dimensions[1]);
7197 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
7198 __pyx_v_k = __pyx_t_9;
7207 if (unlikely(__pyx_v_material_functions == Py_None)) {
7208 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7209 __PYX_ERR(0, 267, __pyx_L1_error)
7211 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7212 __Pyx_GOTREF(__pyx_t_11);
7213 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_11);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7214 __Pyx_GOTREF(__pyx_t_12);
7215 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7216 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 267, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_11);
7218 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7219 __Pyx_GOTREF(__pyx_t_13);
7220 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7221 __Pyx_GOTREF(__pyx_t_14);
7222 __Pyx_GIVEREF(__pyx_t_11);
7223 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
7224 __Pyx_GIVEREF(__pyx_t_13);
7225 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
7228 __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 267, __pyx_L1_error)
7229 __Pyx_GOTREF(__pyx_t_13);
7230 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7231 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7232 __Pyx_GOTREF(__pyx_t_14);
7235 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
7236 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
7237 if (likely(__pyx_t_11)) {
7238 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
7239 __Pyx_INCREF(__pyx_t_11);
7240 __Pyx_INCREF(
function);
7241 __Pyx_DECREF_SET(__pyx_t_12,
function);
7245 #if CYTHON_FAST_PYCALL 7246 if (PyFunction_Check(__pyx_t_12)) {
7247 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7248 __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7249 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7250 __Pyx_GOTREF(__pyx_t_10);
7251 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7252 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7255 #if CYTHON_FAST_PYCCALL 7256 if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
7257 PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_14};
7258 __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7259 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
7260 __Pyx_GOTREF(__pyx_t_10);
7261 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7262 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7266 __pyx_t_15 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 267, __pyx_L1_error)
7267 __Pyx_GOTREF(__pyx_t_15);
7269 __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11); __pyx_t_11 = NULL;
7271 __Pyx_GIVEREF(__pyx_t_13);
7272 PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_5, __pyx_t_13);
7273 __Pyx_GIVEREF(__pyx_t_14);
7274 PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_5, __pyx_t_14);
7277 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_15, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 267, __pyx_L1_error)
7278 __Pyx_GOTREF(__pyx_t_10);
7279 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7281 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7290 if (unlikely(__pyx_v_material_functions == Py_None)) {
7291 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7292 __PYX_ERR(0, 268, __pyx_L1_error)
7294 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7295 __Pyx_GOTREF(__pyx_t_15);
7296 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
7297 __Pyx_GOTREF(__pyx_t_14);
7298 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7299 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
7300 __Pyx_GOTREF(__pyx_t_15);
7301 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7302 __Pyx_GOTREF(__pyx_t_13);
7303 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7304 __Pyx_GOTREF(__pyx_t_11);
7305 __Pyx_GIVEREF(__pyx_t_15);
7306 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15);
7307 __Pyx_GIVEREF(__pyx_t_13);
7308 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
7311 __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_11);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_13);
7313 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7314 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L1_error)
7315 __Pyx_GOTREF(__pyx_t_11);
7318 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
7319 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
7320 if (likely(__pyx_t_15)) {
7321 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
7322 __Pyx_INCREF(__pyx_t_15);
7323 __Pyx_INCREF(
function);
7324 __Pyx_DECREF_SET(__pyx_t_14,
function);
7328 #if CYTHON_FAST_PYCALL 7329 if (PyFunction_Check(__pyx_t_14)) {
7330 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7331 __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7332 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7333 __Pyx_GOTREF(__pyx_t_12);
7334 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7335 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7338 #if CYTHON_FAST_PYCCALL 7339 if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
7340 PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_11};
7341 __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7342 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7343 __Pyx_GOTREF(__pyx_t_12);
7344 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7345 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7349 __pyx_t_16 = PyTuple_New(2+__pyx_t_5);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 268, __pyx_L1_error)
7350 __Pyx_GOTREF(__pyx_t_16);
7352 __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
7354 __Pyx_GIVEREF(__pyx_t_13);
7355 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_5, __pyx_t_13);
7356 __Pyx_GIVEREF(__pyx_t_11);
7357 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_5, __pyx_t_11);
7360 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_12);
7362 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7364 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7373 __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_t_12);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 267, __pyx_L1_error)
7374 __Pyx_GOTREF(__pyx_t_14);
7375 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7376 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7377 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_14);
if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 267, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_12);
7379 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7380 __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_17 == ((npy_double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
7381 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7382 __pyx_t_18 = __pyx_v_ebN;
7383 __pyx_t_19 = __pyx_v_k;
7385 if (__pyx_t_18 < 0) {
7386 __pyx_t_18 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7387 if (unlikely(__pyx_t_18 < 0)) __pyx_t_5 = 0;
7388 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_5 = 0;
7389 if (__pyx_t_19 < 0) {
7390 __pyx_t_19 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7391 if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 1;
7392 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_5 = 1;
7393 if (unlikely(__pyx_t_5 != -1)) {
7394 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7395 __PYX_ERR(0, 267, __pyx_L1_error)
7397 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_17;
7410 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7413 __Pyx_XDECREF(__pyx_t_10);
7414 __Pyx_XDECREF(__pyx_t_11);
7415 __Pyx_XDECREF(__pyx_t_12);
7416 __Pyx_XDECREF(__pyx_t_13);
7417 __Pyx_XDECREF(__pyx_t_14);
7418 __Pyx_XDECREF(__pyx_t_15);
7419 __Pyx_XDECREF(__pyx_t_16);
7420 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7421 __Pyx_PyThreadState_declare
7422 __Pyx_PyThreadState_assign
7423 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7424 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7425 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7426 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7427 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7428 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7429 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7433 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7434 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7435 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7436 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7438 __Pyx_XGIVEREF(__pyx_r);
7439 __Pyx_RefNannyFinishContext();
7452 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7453 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
7454 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
7455 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7458 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7459 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7460 PyArrayObject *__pyx_v_x = 0;
7461 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7462 PyObject *__pyx_v_material_functions = 0;
7463 PyObject *__pyx_r = 0;
7464 __Pyx_RefNannyDeclarations
7465 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7467 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7468 PyObject* values[7] = {0,0,0,0,0,0,0};
7469 if (unlikely(__pyx_kwds)) {
7471 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7473 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7474 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7475 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7476 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7477 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7478 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7479 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7481 default:
goto __pyx_L5_argtuple_error;
7483 kw_args = PyDict_Size(__pyx_kwds);
7486 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7487 else goto __pyx_L5_argtuple_error;
7489 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7491 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); __PYX_ERR(0, 271, __pyx_L3_error)
7494 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7496 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); __PYX_ERR(0, 271, __pyx_L3_error)
7499 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7501 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); __PYX_ERR(0, 271, __pyx_L3_error)
7504 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7506 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); __PYX_ERR(0, 271, __pyx_L3_error)
7509 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7511 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); __PYX_ERR(0, 271, __pyx_L3_error)
7514 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7516 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); __PYX_ERR(0, 271, __pyx_L3_error)
7519 if (unlikely(kw_args > 0)) {
7520 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
7522 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
7523 goto __pyx_L5_argtuple_error;
7525 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7526 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7527 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7528 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7529 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7530 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7531 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7533 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
7534 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L3_error)
7535 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
7536 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
7537 __pyx_v_x = ((PyArrayObject *)values[4]);
7538 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
7539 __pyx_v_material_functions = ((PyObject*)values[6]);
7541 goto __pyx_L4_argument_unpacking_done;
7542 __pyx_L5_argtuple_error:;
7543 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
7545 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7546 __Pyx_RefNannyFinishContext();
7548 __pyx_L4_argument_unpacking_done:;
7549 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) __PYX_ERR(0, 273, __pyx_L1_error)
7550 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) __PYX_ERR(0, 274, __pyx_L1_error)
7551 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 275, __pyx_L1_error)
7552 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) __PYX_ERR(0, 276, __pyx_L1_error)
7553 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) __PYX_ERR(0, 277, __pyx_L1_error)
7554 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7561 __Pyx_RefNannyFinishContext();
7565 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7568 int __pyx_v_material_left;
7569 int __pyx_v_material_right;
7572 double __pyx_v_numer;
7573 double __pyx_v_denom;
7574 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7575 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7576 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7577 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7578 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7579 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7580 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7581 __Pyx_Buffer __pyx_pybuffer_x;
7582 PyObject *__pyx_r = NULL;
7583 __Pyx_RefNannyDeclarations
7586 Py_ssize_t __pyx_t_3;
7587 Py_ssize_t __pyx_t_4;
7589 Py_ssize_t __pyx_t_6;
7590 Py_ssize_t __pyx_t_7;
7596 PyObject *__pyx_t_13 = NULL;
7597 PyObject *__pyx_t_14 = NULL;
7598 PyObject *__pyx_t_15 = NULL;
7599 PyObject *__pyx_t_16 = NULL;
7600 PyObject *__pyx_t_17 = NULL;
7602 PyObject *__pyx_t_19 = NULL;
7603 PyObject *__pyx_t_20 = NULL;
7605 Py_ssize_t __pyx_t_22;
7606 Py_ssize_t __pyx_t_23;
7607 Py_ssize_t __pyx_t_24;
7608 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
7609 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7610 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7611 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7612 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7613 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7614 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7615 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7616 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7617 __pyx_pybuffer_x.pybuffer.buf = NULL;
7618 __pyx_pybuffer_x.refcount = 0;
7619 __pyx_pybuffernd_x.data = NULL;
7620 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7621 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7622 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7623 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7624 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7626 __Pyx_BufFmt_StackElem __pyx_stack[1];
7627 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
7629 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7631 __Pyx_BufFmt_StackElem __pyx_stack[1];
7632 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
7634 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7636 __Pyx_BufFmt_StackElem __pyx_stack[1];
7637 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
7639 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
7641 __Pyx_BufFmt_StackElem __pyx_stack[1];
7642 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 271, __pyx_L1_error)
7644 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
7653 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7654 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
7655 __pyx_v_ebN = __pyx_t_2;
7664 __pyx_t_3 = __pyx_v_ebN;
7667 if (__pyx_t_3 < 0) {
7668 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7669 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
7670 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7671 if (__pyx_t_4 < 0) {
7672 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7673 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
7674 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7675 if (unlikely(__pyx_t_5 != -1)) {
7676 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7677 __PYX_ERR(0, 289, __pyx_L1_error)
7679 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7688 __pyx_t_6 = __pyx_v_ebN;
7691 if (__pyx_t_6 < 0) {
7692 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7693 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
7694 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7695 if (__pyx_t_7 < 0) {
7696 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7697 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
7698 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7699 if (unlikely(__pyx_t_5 != -1)) {
7700 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7701 __PYX_ERR(0, 290, __pyx_L1_error)
7703 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7712 __pyx_t_8 = (__pyx_v_x->dimensions[1]);
7713 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
7714 __pyx_v_k = __pyx_t_5;
7723 __pyx_t_9 = __pyx_v_nd;
7724 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
7725 __pyx_v_I = __pyx_t_10;
7734 __pyx_t_11 = __pyx_v_nd;
7735 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
7736 __pyx_v_J = __pyx_t_12;
7745 if (unlikely(__pyx_v_material_functions == Py_None)) {
7746 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7747 __PYX_ERR(0, 294, __pyx_L1_error)
7749 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7750 __Pyx_GOTREF(__pyx_t_14);
7751 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
7752 __Pyx_GOTREF(__pyx_t_15);
7753 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7754 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7755 __Pyx_GOTREF(__pyx_t_14);
7756 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
7757 __Pyx_GOTREF(__pyx_t_16);
7758 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
7759 __Pyx_GOTREF(__pyx_t_17);
7760 __Pyx_GIVEREF(__pyx_t_14);
7761 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
7762 __Pyx_GIVEREF(__pyx_t_16);
7763 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
7766 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
7767 __Pyx_GOTREF(__pyx_t_16);
7768 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7769 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
7770 __Pyx_GOTREF(__pyx_t_17);
7773 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
7774 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
7775 if (likely(__pyx_t_14)) {
7776 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
7777 __Pyx_INCREF(__pyx_t_14);
7778 __Pyx_INCREF(
function);
7779 __Pyx_DECREF_SET(__pyx_t_15,
function);
7783 #if CYTHON_FAST_PYCALL 7784 if (PyFunction_Check(__pyx_t_15)) {
7785 PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_16, __pyx_t_17};
7786 __pyx_t_13 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
7787 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
7788 __Pyx_GOTREF(__pyx_t_13);
7789 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7790 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7793 #if CYTHON_FAST_PYCCALL 7794 if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
7795 PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_16, __pyx_t_17};
7796 __pyx_t_13 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
7797 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
7798 __Pyx_GOTREF(__pyx_t_13);
7799 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7800 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7804 __pyx_t_19 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7805 __Pyx_GOTREF(__pyx_t_19);
7807 __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_14); __pyx_t_14 = NULL;
7809 __Pyx_GIVEREF(__pyx_t_16);
7810 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_16);
7811 __Pyx_GIVEREF(__pyx_t_17);
7812 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_17);
7815 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
7816 __Pyx_GOTREF(__pyx_t_13);
7817 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7819 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7820 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
7821 __Pyx_GOTREF(__pyx_t_15);
7822 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7823 __Pyx_GOTREF(__pyx_t_19);
7824 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
7825 __Pyx_GOTREF(__pyx_t_17);
7826 __Pyx_GIVEREF(__pyx_t_15);
7827 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
7828 __Pyx_GIVEREF(__pyx_t_19);
7829 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19);
7832 __pyx_t_19 = PyObject_GetItem(__pyx_t_13, __pyx_t_17);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7833 __Pyx_GOTREF(__pyx_t_19);
7834 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7835 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7836 __pyx_t_17 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 294, __pyx_L1_error)
7837 __Pyx_GOTREF(__pyx_t_17);
7838 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7839 if (unlikely(__pyx_v_material_functions == Py_None)) {
7840 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7841 __PYX_ERR(0, 294, __pyx_L1_error)
7843 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
7844 __Pyx_GOTREF(__pyx_t_13);
7845 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
7846 __Pyx_GOTREF(__pyx_t_15);
7847 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7848 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 294, __pyx_L1_error)
7849 __Pyx_GOTREF(__pyx_t_13);
7850 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
7851 __Pyx_GOTREF(__pyx_t_16);
7852 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7853 __Pyx_GOTREF(__pyx_t_14);
7854 __Pyx_GIVEREF(__pyx_t_13);
7855 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
7856 __Pyx_GIVEREF(__pyx_t_16);
7857 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16);
7860 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 294, __pyx_L1_error)
7861 __Pyx_GOTREF(__pyx_t_16);
7862 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7863 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7864 __Pyx_GOTREF(__pyx_t_14);
7867 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
7868 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
7869 if (likely(__pyx_t_13)) {
7870 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
7871 __Pyx_INCREF(__pyx_t_13);
7872 __Pyx_INCREF(
function);
7873 __Pyx_DECREF_SET(__pyx_t_15,
function);
7877 #if CYTHON_FAST_PYCALL 7878 if (PyFunction_Check(__pyx_t_15)) {
7879 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_16, __pyx_t_14};
7880 __pyx_t_19 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7881 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7882 __Pyx_GOTREF(__pyx_t_19);
7883 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7884 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7887 #if CYTHON_FAST_PYCCALL 7888 if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
7889 PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_16, __pyx_t_14};
7890 __pyx_t_19 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7891 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7892 __Pyx_GOTREF(__pyx_t_19);
7893 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7894 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7898 __pyx_t_20 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
7899 __Pyx_GOTREF(__pyx_t_20);
7901 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_13); __pyx_t_13 = NULL;
7903 __Pyx_GIVEREF(__pyx_t_16);
7904 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_18, __pyx_t_16);
7905 __Pyx_GIVEREF(__pyx_t_14);
7906 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_18, __pyx_t_14);
7909 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 294, __pyx_L1_error)
7910 __Pyx_GOTREF(__pyx_t_19);
7911 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7913 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7914 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 294, __pyx_L1_error)
7915 __Pyx_GOTREF(__pyx_t_15);
7916 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
7917 __Pyx_GOTREF(__pyx_t_20);
7918 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7919 __Pyx_GOTREF(__pyx_t_14);
7920 __Pyx_GIVEREF(__pyx_t_15);
7921 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
7922 __Pyx_GIVEREF(__pyx_t_20);
7923 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_20);
7926 __pyx_t_20 = PyObject_GetItem(__pyx_t_19, __pyx_t_14);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 294, __pyx_L1_error)
7927 __Pyx_GOTREF(__pyx_t_20);
7928 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7929 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7930 __pyx_t_14 = PyNumber_Multiply(__pyx_t_17, __pyx_t_20);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 294, __pyx_L1_error)
7931 __Pyx_GOTREF(__pyx_t_14);
7932 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7933 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7934 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_21 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
7935 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7936 __pyx_v_numer = __pyx_t_21;
7945 if (unlikely(__pyx_v_material_functions == Py_None)) {
7946 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7947 __PYX_ERR(0, 295, __pyx_L1_error)
7949 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
7950 __Pyx_GOTREF(__pyx_t_20);
7951 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
7952 __Pyx_GOTREF(__pyx_t_17);
7953 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7954 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
7955 __Pyx_GOTREF(__pyx_t_20);
7956 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
7957 __Pyx_GOTREF(__pyx_t_19);
7958 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
7959 __Pyx_GOTREF(__pyx_t_15);
7960 __Pyx_GIVEREF(__pyx_t_20);
7961 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_20);
7962 __Pyx_GIVEREF(__pyx_t_19);
7963 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_19);
7966 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_15);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
7967 __Pyx_GOTREF(__pyx_t_19);
7968 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7969 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
7970 __Pyx_GOTREF(__pyx_t_15);
7973 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
7974 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_17);
7975 if (likely(__pyx_t_20)) {
7976 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
7977 __Pyx_INCREF(__pyx_t_20);
7978 __Pyx_INCREF(
function);
7979 __Pyx_DECREF_SET(__pyx_t_17,
function);
7983 #if CYTHON_FAST_PYCALL 7984 if (PyFunction_Check(__pyx_t_17)) {
7985 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_15};
7986 __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 295, __pyx_L1_error)
7987 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7988 __Pyx_GOTREF(__pyx_t_14);
7989 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7990 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7993 #if CYTHON_FAST_PYCCALL 7994 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
7995 PyObject *__pyx_temp[3] = {__pyx_t_20, __pyx_t_19, __pyx_t_15};
7996 __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 295, __pyx_L1_error)
7997 __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7998 __Pyx_GOTREF(__pyx_t_14);
7999 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8000 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8004 __pyx_t_16 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8005 __Pyx_GOTREF(__pyx_t_16);
8007 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL;
8009 __Pyx_GIVEREF(__pyx_t_19);
8010 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_18, __pyx_t_19);
8011 __Pyx_GIVEREF(__pyx_t_15);
8012 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_18, __pyx_t_15);
8015 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 295, __pyx_L1_error)
8016 __Pyx_GOTREF(__pyx_t_14);
8017 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8019 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8020 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8021 __Pyx_GOTREF(__pyx_t_17);
8022 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8023 __Pyx_GOTREF(__pyx_t_16);
8024 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8025 __Pyx_GOTREF(__pyx_t_15);
8026 __Pyx_GIVEREF(__pyx_t_17);
8027 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17);
8028 __Pyx_GIVEREF(__pyx_t_16);
8029 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16);
8032 __pyx_t_16 = PyObject_GetItem(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 295, __pyx_L1_error)
8033 __Pyx_GOTREF(__pyx_t_16);
8034 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
8035 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8036 if (unlikely(__pyx_v_material_functions == Py_None)) {
8037 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
8038 __PYX_ERR(0, 295, __pyx_L1_error)
8040 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 295, __pyx_L1_error)
8041 __Pyx_GOTREF(__pyx_t_14);
8042 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8043 __Pyx_GOTREF(__pyx_t_17);
8044 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
8045 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 295, __pyx_L1_error)
8046 __Pyx_GOTREF(__pyx_t_14);
8047 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8048 __Pyx_GOTREF(__pyx_t_19);
8049 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8050 __Pyx_GOTREF(__pyx_t_20);
8051 __Pyx_GIVEREF(__pyx_t_14);
8052 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_14);
8053 __Pyx_GIVEREF(__pyx_t_19);
8054 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
8057 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 295, __pyx_L1_error)
8058 __Pyx_GOTREF(__pyx_t_19);
8059 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8060 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8061 __Pyx_GOTREF(__pyx_t_20);
8064 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
8065 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
8066 if (likely(__pyx_t_14)) {
8067 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
8068 __Pyx_INCREF(__pyx_t_14);
8069 __Pyx_INCREF(
function);
8070 __Pyx_DECREF_SET(__pyx_t_17,
function);
8074 #if CYTHON_FAST_PYCALL 8075 if (PyFunction_Check(__pyx_t_17)) {
8076 PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_19, __pyx_t_20};
8077 __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8078 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
8079 __Pyx_GOTREF(__pyx_t_15);
8080 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8081 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8084 #if CYTHON_FAST_PYCCALL 8085 if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
8086 PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_19, __pyx_t_20};
8087 __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8088 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
8089 __Pyx_GOTREF(__pyx_t_15);
8090 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
8091 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8095 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
8096 __Pyx_GOTREF(__pyx_t_13);
8098 __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
8100 __Pyx_GIVEREF(__pyx_t_19);
8101 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_19);
8102 __Pyx_GIVEREF(__pyx_t_20);
8103 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_20);
8106 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 295, __pyx_L1_error)
8107 __Pyx_GOTREF(__pyx_t_15);
8108 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8110 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
8111 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 295, __pyx_L1_error)
8112 __Pyx_GOTREF(__pyx_t_17);
8113 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
8114 __Pyx_GOTREF(__pyx_t_13);
8115 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8116 __Pyx_GOTREF(__pyx_t_20);
8117 __Pyx_GIVEREF(__pyx_t_17);
8118 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
8119 __Pyx_GIVEREF(__pyx_t_13);
8120 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_13);
8123 __pyx_t_13 = PyObject_GetItem(__pyx_t_15, __pyx_t_20);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_13);
8125 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
8126 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8127 __pyx_t_20 = PyNumber_Add(__pyx_t_16, __pyx_t_13);
if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 295, __pyx_L1_error)
8128 __Pyx_GOTREF(__pyx_t_20);
8129 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
8130 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8131 __pyx_t_13 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
8132 __Pyx_GOTREF(__pyx_t_13);
8133 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
8134 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_13);
if (unlikely((__pyx_t_21 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
8135 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8136 __pyx_v_denom = __pyx_t_21;
8145 if (unlikely(__pyx_v_denom == 0)) {
8146 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8147 __PYX_ERR(0, 296, __pyx_L1_error)
8149 __pyx_t_22 = __pyx_v_ebN;
8150 __pyx_t_23 = __pyx_v_k;
8151 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
8153 if (__pyx_t_22 < 0) {
8154 __pyx_t_22 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
8155 if (unlikely(__pyx_t_22 < 0)) __pyx_t_18 = 0;
8156 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_18 = 0;
8157 if (__pyx_t_23 < 0) {
8158 __pyx_t_23 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
8159 if (unlikely(__pyx_t_23 < 0)) __pyx_t_18 = 1;
8160 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_18 = 1;
8161 if (__pyx_t_24 < 0) {
8162 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
8163 if (unlikely(__pyx_t_24 < 0)) __pyx_t_18 = 2;
8164 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_18 = 2;
8165 if (unlikely(__pyx_t_18 != -1)) {
8166 __Pyx_RaiseBufferIndexError(__pyx_t_18);
8167 __PYX_ERR(0, 296, __pyx_L1_error)
8169 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
8184 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8187 __Pyx_XDECREF(__pyx_t_13);
8188 __Pyx_XDECREF(__pyx_t_14);
8189 __Pyx_XDECREF(__pyx_t_15);
8190 __Pyx_XDECREF(__pyx_t_16);
8191 __Pyx_XDECREF(__pyx_t_17);
8192 __Pyx_XDECREF(__pyx_t_19);
8193 __Pyx_XDECREF(__pyx_t_20);
8194 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8195 __Pyx_PyThreadState_declare
8196 __Pyx_PyThreadState_assign
8197 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8198 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8199 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8200 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8201 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8202 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8203 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
8207 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
8208 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
8209 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
8210 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
8212 __Pyx_XGIVEREF(__pyx_r);
8213 __Pyx_RefNannyFinishContext();
8226 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8227 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8228 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
8229 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8231 PyArrayObject *__pyx_v_gravity = 0;
8232 PyArrayObject *__pyx_v_rowptr = 0;
8233 PyArrayObject *__pyx_v_colind = 0;
8234 PyArrayObject *__pyx_v_KWs = 0;
8236 int __pyx_v_nElements_global;
8237 int __pyx_v_nElementBoundaries_element;
8238 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8239 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8240 PyArrayObject *__pyx_v_q_flin = 0;
8241 PyArrayObject *__pyx_v_q_alin = 0;
8242 PyObject *__pyx_r = 0;
8243 __Pyx_RefNannyDeclarations
8244 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
8246 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
8247 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
8248 if (unlikely(__pyx_kwds)) {
8250 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8252 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8253 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8254 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8255 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8256 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8257 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8258 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8259 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8260 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8261 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8262 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8263 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8265 default:
goto __pyx_L5_argtuple_error;
8267 kw_args = PyDict_Size(__pyx_kwds);
8270 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8271 else goto __pyx_L5_argtuple_error;
8273 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8275 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); __PYX_ERR(0, 301, __pyx_L3_error)
8278 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
8280 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); __PYX_ERR(0, 301, __pyx_L3_error)
8283 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
8285 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); __PYX_ERR(0, 301, __pyx_L3_error)
8288 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
8290 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); __PYX_ERR(0, 301, __pyx_L3_error)
8293 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8295 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); __PYX_ERR(0, 301, __pyx_L3_error)
8298 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8300 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); __PYX_ERR(0, 301, __pyx_L3_error)
8303 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8305 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); __PYX_ERR(0, 301, __pyx_L3_error)
8308 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8310 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); __PYX_ERR(0, 301, __pyx_L3_error)
8313 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8315 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); __PYX_ERR(0, 301, __pyx_L3_error)
8318 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
8320 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); __PYX_ERR(0, 301, __pyx_L3_error)
8323 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
8325 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); __PYX_ERR(0, 301, __pyx_L3_error)
8328 if (unlikely(kw_args > 0)) {
8329 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) __PYX_ERR(0, 301, __pyx_L3_error)
8331 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
8332 goto __pyx_L5_argtuple_error;
8334 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8335 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8336 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8337 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8338 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8339 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8340 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8341 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8342 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8343 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8344 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8345 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8347 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 301, __pyx_L3_error)
8348 __pyx_v_gravity = ((PyArrayObject *)values[1]);
8349 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
8350 __pyx_v_colind = ((PyArrayObject *)values[3]);
8351 __pyx_v_KWs = ((PyArrayObject *)values[4]);
8352 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
8353 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L3_error)
8354 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L3_error)
8355 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
8356 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
8357 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
8358 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
8360 goto __pyx_L4_argument_unpacking_done;
8361 __pyx_L5_argtuple_error:;
8362 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error)
8364 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8365 __Pyx_RefNannyFinishContext();
8367 __pyx_L4_argument_unpacking_done:;
8368 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
8369 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 303, __pyx_L1_error)
8370 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 304, __pyx_L1_error)
8371 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) __PYX_ERR(0, 305, __pyx_L1_error)
8372 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 310, __pyx_L1_error)
8373 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 311, __pyx_L1_error)
8374 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 312, __pyx_L1_error)
8375 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 313, __pyx_L1_error)
8376 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
8383 __Pyx_RefNannyFinishContext();
8387 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
8389 int __pyx_v_eN_neighbor;
8394 int __pyx_v_matID_neig;
8395 CYTHON_UNUSED
int __pyx_v_nSpace2;
8397 PyArrayObject *__pyx_v_a_eN = 0;
8398 PyArrayObject *__pyx_v_a_neig = 0;
8399 PyArrayObject *__pyx_v_a_avg = 0;
8400 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
8401 __Pyx_Buffer __pyx_pybuffer_KWs;
8402 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
8403 __Pyx_Buffer __pyx_pybuffer_a_avg;
8404 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
8405 __Pyx_Buffer __pyx_pybuffer_a_eN;
8406 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
8407 __Pyx_Buffer __pyx_pybuffer_a_neig;
8408 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
8409 __Pyx_Buffer __pyx_pybuffer_colind;
8410 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
8411 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
8412 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
8413 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
8414 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
8415 __Pyx_Buffer __pyx_pybuffer_gravity;
8416 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
8417 __Pyx_Buffer __pyx_pybuffer_q_alin;
8418 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
8419 __Pyx_Buffer __pyx_pybuffer_q_flin;
8420 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
8421 __Pyx_Buffer __pyx_pybuffer_rowptr;
8422 PyObject *__pyx_r = NULL;
8423 __Pyx_RefNannyDeclarations
8424 Py_ssize_t __pyx_t_1;
8426 PyObject *__pyx_t_3 = NULL;
8427 PyObject *__pyx_t_4 = NULL;
8428 PyObject *__pyx_t_5 = NULL;
8429 PyObject *__pyx_t_6 = NULL;
8430 PyObject *__pyx_t_7 = NULL;
8431 PyArrayObject *__pyx_t_8 = NULL;
8432 PyArrayObject *__pyx_t_9 = NULL;
8433 PyArrayObject *__pyx_t_10 = NULL;
8435 Py_ssize_t __pyx_t_12;
8438 Py_ssize_t __pyx_t_15;
8439 Py_ssize_t __pyx_t_16;
8441 Py_ssize_t __pyx_t_18;
8442 Py_ssize_t __pyx_t_19;
8443 Py_ssize_t __pyx_t_20;
8445 Py_ssize_t __pyx_t_22;
8447 Py_ssize_t __pyx_t_24;
8449 Py_ssize_t __pyx_t_26;
8450 Py_ssize_t __pyx_t_27;
8451 Py_ssize_t __pyx_t_28;
8452 Py_ssize_t __pyx_t_29;
8453 Py_ssize_t __pyx_t_30;
8454 Py_ssize_t __pyx_t_31;
8455 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_32;
8456 Py_ssize_t __pyx_t_33;
8457 Py_ssize_t __pyx_t_34;
8458 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_35;
8459 Py_ssize_t __pyx_t_36;
8460 Py_ssize_t __pyx_t_37;
8461 Py_ssize_t __pyx_t_38;
8462 Py_ssize_t __pyx_t_39;
8463 Py_ssize_t __pyx_t_40;
8464 Py_ssize_t __pyx_t_41;
8465 Py_ssize_t __pyx_t_42;
8466 Py_ssize_t __pyx_t_43;
8467 Py_ssize_t __pyx_t_44;
8468 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_45;
8469 Py_ssize_t __pyx_t_46;
8470 Py_ssize_t __pyx_t_47;
8472 Py_ssize_t __pyx_t_49;
8473 Py_ssize_t __pyx_t_50;
8474 Py_ssize_t __pyx_t_51;
8475 Py_ssize_t __pyx_t_52;
8476 Py_ssize_t __pyx_t_53;
8477 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
8478 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
8479 __pyx_pybuffer_a_eN.refcount = 0;
8480 __pyx_pybuffernd_a_eN.data = NULL;
8481 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
8482 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
8483 __pyx_pybuffer_a_neig.refcount = 0;
8484 __pyx_pybuffernd_a_neig.data = NULL;
8485 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
8486 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
8487 __pyx_pybuffer_a_avg.refcount = 0;
8488 __pyx_pybuffernd_a_avg.data = NULL;
8489 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
8490 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
8491 __pyx_pybuffer_gravity.refcount = 0;
8492 __pyx_pybuffernd_gravity.data = NULL;
8493 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
8494 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
8495 __pyx_pybuffer_rowptr.refcount = 0;
8496 __pyx_pybuffernd_rowptr.data = NULL;
8497 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
8498 __pyx_pybuffer_colind.pybuffer.buf = NULL;
8499 __pyx_pybuffer_colind.refcount = 0;
8500 __pyx_pybuffernd_colind.data = NULL;
8501 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
8502 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
8503 __pyx_pybuffer_KWs.refcount = 0;
8504 __pyx_pybuffernd_KWs.data = NULL;
8505 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
8506 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
8507 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
8508 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
8509 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
8510 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
8511 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
8512 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
8513 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
8514 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
8515 __pyx_pybuffer_q_flin.refcount = 0;
8516 __pyx_pybuffernd_q_flin.data = NULL;
8517 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
8518 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
8519 __pyx_pybuffer_q_alin.refcount = 0;
8520 __pyx_pybuffernd_q_alin.data = NULL;
8521 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
8523 __Pyx_BufFmt_StackElem __pyx_stack[1];
8524 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8526 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
8528 __Pyx_BufFmt_StackElem __pyx_stack[1];
8529 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8531 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
8533 __Pyx_BufFmt_StackElem __pyx_stack[1];
8534 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8536 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
8538 __Pyx_BufFmt_StackElem __pyx_stack[1];
8539 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8541 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
8543 __Pyx_BufFmt_StackElem __pyx_stack[1];
8544 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8546 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
8548 __Pyx_BufFmt_StackElem __pyx_stack[1];
8549 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8551 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
8553 __Pyx_BufFmt_StackElem __pyx_stack[1];
8554 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8556 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
8558 __Pyx_BufFmt_StackElem __pyx_stack[1];
8559 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 301, __pyx_L1_error)
8561 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
8570 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
8579 __pyx_t_1 = __pyx_v_nSpace;
8581 if (__pyx_t_1 < 0) {
8582 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
8583 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
8584 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
8585 if (unlikely(__pyx_t_2 != -1)) {
8586 __Pyx_RaiseBufferIndexError(__pyx_t_2);
8587 __PYX_ERR(0, 329, __pyx_L1_error)
8589 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
8598 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
8599 __Pyx_GOTREF(__pyx_t_4);
8600 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
8601 __Pyx_GOTREF(__pyx_t_5);
8602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8603 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
8604 __Pyx_GOTREF(__pyx_t_4);
8607 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8608 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8609 if (likely(__pyx_t_6)) {
8610 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8611 __Pyx_INCREF(__pyx_t_6);
8612 __Pyx_INCREF(
function);
8613 __Pyx_DECREF_SET(__pyx_t_5,
function);
8617 #if CYTHON_FAST_PYCALL 8618 if (PyFunction_Check(__pyx_t_5)) {
8619 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
8620 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
8621 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8622 __Pyx_GOTREF(__pyx_t_3);
8623 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8626 #if CYTHON_FAST_PYCCALL 8627 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8628 PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_d};
8629 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
8630 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8631 __Pyx_GOTREF(__pyx_t_3);
8632 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8636 __pyx_t_7 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
8637 __Pyx_GOTREF(__pyx_t_7);
8639 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
8641 __Pyx_GIVEREF(__pyx_t_4);
8642 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_4);
8643 __Pyx_INCREF(__pyx_n_s_d);
8644 __Pyx_GIVEREF(__pyx_n_s_d);
8645 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_n_s_d);
8647 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
8648 __Pyx_GOTREF(__pyx_t_3);
8649 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8651 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8652 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 331, __pyx_L1_error)
8653 __pyx_t_8 = ((PyArrayObject *)__pyx_t_3);
8655 __Pyx_BufFmt_StackElem __pyx_stack[1];
8656 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8657 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
8658 __PYX_ERR(0, 331, __pyx_L1_error)
8659 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
8663 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
8673 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
8674 __Pyx_GOTREF(__pyx_t_5);
8675 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
8676 __Pyx_GOTREF(__pyx_t_7);
8677 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8678 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
8679 __Pyx_GOTREF(__pyx_t_5);
8682 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
8683 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
8684 if (likely(__pyx_t_4)) {
8685 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
8686 __Pyx_INCREF(__pyx_t_4);
8687 __Pyx_INCREF(
function);
8688 __Pyx_DECREF_SET(__pyx_t_7,
function);
8692 #if CYTHON_FAST_PYCALL 8693 if (PyFunction_Check(__pyx_t_7)) {
8694 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
8695 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8696 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8697 __Pyx_GOTREF(__pyx_t_3);
8698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8701 #if CYTHON_FAST_PYCCALL 8702 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
8703 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
8704 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8705 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8706 __Pyx_GOTREF(__pyx_t_3);
8707 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8711 __pyx_t_6 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
8712 __Pyx_GOTREF(__pyx_t_6);
8714 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
8716 __Pyx_GIVEREF(__pyx_t_5);
8717 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_5);
8718 __Pyx_INCREF(__pyx_n_s_d);
8719 __Pyx_GIVEREF(__pyx_n_s_d);
8720 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_n_s_d);
8722 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
8723 __Pyx_GOTREF(__pyx_t_3);
8724 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8726 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8727 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 332, __pyx_L1_error)
8728 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
8730 __Pyx_BufFmt_StackElem __pyx_stack[1];
8731 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8732 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
8733 __PYX_ERR(0, 332, __pyx_L1_error)
8734 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
8738 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
8748 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
8749 __Pyx_GOTREF(__pyx_t_7);
8750 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
8751 __Pyx_GOTREF(__pyx_t_6);
8752 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8753 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
8754 __Pyx_GOTREF(__pyx_t_7);
8757 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8758 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
8759 if (likely(__pyx_t_5)) {
8760 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
8761 __Pyx_INCREF(__pyx_t_5);
8762 __Pyx_INCREF(
function);
8763 __Pyx_DECREF_SET(__pyx_t_6,
function);
8767 #if CYTHON_FAST_PYCALL 8768 if (PyFunction_Check(__pyx_t_6)) {
8769 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
8770 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
8771 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8772 __Pyx_GOTREF(__pyx_t_3);
8773 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8776 #if CYTHON_FAST_PYCCALL 8777 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
8778 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_7, __pyx_n_s_d};
8779 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
8780 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8781 __Pyx_GOTREF(__pyx_t_3);
8782 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8786 __pyx_t_4 = PyTuple_New(2+__pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
8787 __Pyx_GOTREF(__pyx_t_4);
8789 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
8791 __Pyx_GIVEREF(__pyx_t_7);
8792 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_t_7);
8793 __Pyx_INCREF(__pyx_n_s_d);
8794 __Pyx_GIVEREF(__pyx_n_s_d);
8795 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_n_s_d);
8797 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
8798 __Pyx_GOTREF(__pyx_t_3);
8799 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8801 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8802 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 333, __pyx_L1_error)
8803 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
8805 __Pyx_BufFmt_StackElem __pyx_stack[1];
8806 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8807 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
8808 __PYX_ERR(0, 333, __pyx_L1_error)
8809 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
8813 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
8823 __pyx_t_2 = __pyx_v_nElements_global;
8824 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_2; __pyx_t_11+=1) {
8825 __pyx_v_eN = __pyx_t_11;
8834 __pyx_t_12 = __pyx_v_eN;
8836 if (__pyx_t_12 < 0) {
8837 __pyx_t_12 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
8838 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
8839 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_13 = 0;
8840 if (unlikely(__pyx_t_13 != -1)) {
8841 __Pyx_RaiseBufferIndexError(__pyx_t_13);
8842 __PYX_ERR(0, 337, __pyx_L1_error)
8844 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
8853 __pyx_t_13 = __pyx_v_nnz;
8854 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8855 __pyx_v_ii = __pyx_t_14;
8864 __pyx_t_15 = __pyx_v_matID;
8865 __pyx_t_16 = __pyx_v_ii;
8867 if (__pyx_t_15 < 0) {
8868 __pyx_t_15 += __pyx_pybuffernd_KWs.diminfo[0].shape;
8869 if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0;
8870 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_17 = 0;
8871 if (__pyx_t_16 < 0) {
8872 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[1].shape;
8873 if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1;
8874 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_17 = 1;
8875 if (unlikely(__pyx_t_17 != -1)) {
8876 __Pyx_RaiseBufferIndexError(__pyx_t_17);
8877 __PYX_ERR(0, 339, __pyx_L1_error)
8879 __pyx_t_18 = __pyx_v_ii;
8881 if (__pyx_t_18 < 0) {
8882 __pyx_t_18 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8883 if (unlikely(__pyx_t_18 < 0)) __pyx_t_17 = 0;
8884 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_17 = 0;
8885 if (unlikely(__pyx_t_17 != -1)) {
8886 __Pyx_RaiseBufferIndexError(__pyx_t_17);
8887 __PYX_ERR(0, 339, __pyx_L1_error)
8889 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[1].strides)));
8899 __pyx_t_13 = __pyx_v_nElementBoundaries_element;
8900 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
8901 __pyx_v_ebN = __pyx_t_14;
8910 __pyx_t_19 = __pyx_v_eN;
8911 __pyx_t_20 = __pyx_v_ebN;
8913 if (__pyx_t_19 < 0) {
8914 __pyx_t_19 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
8915 if (unlikely(__pyx_t_19 < 0)) __pyx_t_17 = 0;
8916 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_17 = 0;
8917 if (__pyx_t_20 < 0) {
8918 __pyx_t_20 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
8919 if (unlikely(__pyx_t_20 < 0)) __pyx_t_17 = 1;
8920 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_17 = 1;
8921 if (unlikely(__pyx_t_17 != -1)) {
8922 __Pyx_RaiseBufferIndexError(__pyx_t_17);
8923 __PYX_ERR(0, 341, __pyx_L1_error)
8925 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
8934 __pyx_t_17 = __pyx_v_nnz;
8935 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_17; __pyx_t_21+=1) {
8936 __pyx_v_ii = __pyx_t_21;
8945 __pyx_t_22 = __pyx_v_ii;
8947 if (__pyx_t_22 < 0) {
8948 __pyx_t_22 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8949 if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 0;
8950 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_23 = 0;
8951 if (unlikely(__pyx_t_23 != -1)) {
8952 __Pyx_RaiseBufferIndexError(__pyx_t_23);
8953 __PYX_ERR(0, 343, __pyx_L1_error)
8955 __pyx_t_24 = __pyx_v_ii;
8957 if (__pyx_t_24 < 0) {
8958 __pyx_t_24 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
8959 if (unlikely(__pyx_t_24 < 0)) __pyx_t_23 = 0;
8960 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_23 = 0;
8961 if (unlikely(__pyx_t_23 != -1)) {
8962 __Pyx_RaiseBufferIndexError(__pyx_t_23);
8963 __PYX_ERR(0, 343, __pyx_L1_error)
8965 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_a_eN.diminfo[0].strides));
8975 __pyx_t_25 = ((__pyx_v_eN_neighbor >= 0) != 0);
8985 __pyx_t_26 = __pyx_v_eN_neighbor;
8987 if (__pyx_t_26 < 0) {
8988 __pyx_t_26 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
8989 if (unlikely(__pyx_t_26 < 0)) __pyx_t_17 = 0;
8990 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_17 = 0;
8991 if (unlikely(__pyx_t_17 != -1)) {
8992 __Pyx_RaiseBufferIndexError(__pyx_t_17);
8993 __PYX_ERR(0, 345, __pyx_L1_error)
8995 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9004 __pyx_t_17 = __pyx_v_nnz;
9005 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_17; __pyx_t_21+=1) {
9006 __pyx_v_ii = __pyx_t_21;
9015 __pyx_t_27 = __pyx_v_matID_neig;
9016 __pyx_t_28 = __pyx_v_ii;
9018 if (__pyx_t_27 < 0) {
9019 __pyx_t_27 += __pyx_pybuffernd_KWs.diminfo[0].shape;
9020 if (unlikely(__pyx_t_27 < 0)) __pyx_t_23 = 0;
9021 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_23 = 0;
9022 if (__pyx_t_28 < 0) {
9023 __pyx_t_28 += __pyx_pybuffernd_KWs.diminfo[1].shape;
9024 if (unlikely(__pyx_t_28 < 0)) __pyx_t_23 = 1;
9025 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_23 = 1;
9026 if (unlikely(__pyx_t_23 != -1)) {
9027 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9028 __PYX_ERR(0, 347, __pyx_L1_error)
9030 __pyx_t_29 = __pyx_v_ii;
9032 if (__pyx_t_29 < 0) {
9033 __pyx_t_29 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9034 if (unlikely(__pyx_t_29 < 0)) __pyx_t_23 = 0;
9035 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_23 = 0;
9036 if (unlikely(__pyx_t_23 != -1)) {
9037 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9038 __PYX_ERR(0, 347, __pyx_L1_error)
9040 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_KWs.diminfo[1].strides)));
9059 __pyx_t_17 = __pyx_v_nnz;
9060 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_17; __pyx_t_21+=1) {
9061 __pyx_v_ii = __pyx_t_21;
9070 __pyx_t_30 = __pyx_v_ii;
9072 if (__pyx_t_30 < 0) {
9073 __pyx_t_30 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9074 if (unlikely(__pyx_t_30 < 0)) __pyx_t_23 = 0;
9075 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_23 = 0;
9076 if (unlikely(__pyx_t_23 != -1)) {
9077 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9078 __PYX_ERR(0, 349, __pyx_L1_error)
9080 __pyx_t_31 = __pyx_v_ii;
9082 if (__pyx_t_31 < 0) {
9083 __pyx_t_31 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9084 if (unlikely(__pyx_t_31 < 0)) __pyx_t_23 = 0;
9085 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_23 = 0;
9086 if (unlikely(__pyx_t_23 != -1)) {
9087 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9088 __PYX_ERR(0, 349, __pyx_L1_error)
9090 __pyx_t_32 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
9091 __pyx_t_33 = __pyx_v_ii;
9093 if (__pyx_t_33 < 0) {
9094 __pyx_t_33 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
9095 if (unlikely(__pyx_t_33 < 0)) __pyx_t_23 = 0;
9096 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_23 = 0;
9097 if (unlikely(__pyx_t_23 != -1)) {
9098 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9099 __PYX_ERR(0, 349, __pyx_L1_error)
9101 __pyx_t_34 = __pyx_v_ii;
9103 if (__pyx_t_34 < 0) {
9104 __pyx_t_34 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
9105 if (unlikely(__pyx_t_34 < 0)) __pyx_t_23 = 0;
9106 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_23 = 0;
9107 if (unlikely(__pyx_t_23 != -1)) {
9108 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9109 __PYX_ERR(0, 349, __pyx_L1_error)
9111 __pyx_t_35 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
9112 if (unlikely(__pyx_t_35 == 0)) {
9113 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9114 __PYX_ERR(0, 349, __pyx_L1_error)
9116 __pyx_t_36 = __pyx_v_ii;
9118 if (__pyx_t_36 < 0) {
9119 __pyx_t_36 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9120 if (unlikely(__pyx_t_36 < 0)) __pyx_t_23 = 0;
9121 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_23 = 0;
9122 if (unlikely(__pyx_t_23 != -1)) {
9123 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9124 __PYX_ERR(0, 349, __pyx_L1_error)
9126 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_32 / __pyx_t_35);
9135 __pyx_t_37 = __pyx_v_ii;
9137 if (__pyx_t_37 < 0) {
9138 __pyx_t_37 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9139 if (unlikely(__pyx_t_37 < 0)) __pyx_t_23 = 0;
9140 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_23 = 0;
9141 if (unlikely(__pyx_t_23 != -1)) {
9142 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9143 __PYX_ERR(0, 350, __pyx_L1_error)
9145 __pyx_t_38 = __pyx_v_eN;
9146 __pyx_t_39 = __pyx_v_ebN;
9147 __pyx_t_40 = __pyx_v_ii;
9149 if (__pyx_t_38 < 0) {
9150 __pyx_t_38 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
9151 if (unlikely(__pyx_t_38 < 0)) __pyx_t_23 = 0;
9152 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_23 = 0;
9153 if (__pyx_t_39 < 0) {
9154 __pyx_t_39 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
9155 if (unlikely(__pyx_t_39 < 0)) __pyx_t_23 = 1;
9156 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_23 = 1;
9157 if (__pyx_t_40 < 0) {
9158 __pyx_t_40 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
9159 if (unlikely(__pyx_t_40 < 0)) __pyx_t_23 = 2;
9160 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_23 = 2;
9161 if (unlikely(__pyx_t_23 != -1)) {
9162 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9163 __PYX_ERR(0, 350, __pyx_L1_error)
9165 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_40, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_avg.diminfo[0].strides));
9175 __pyx_t_17 = __pyx_v_nSpace;
9176 for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_17; __pyx_t_21+=1) {
9177 __pyx_v_I = __pyx_t_21;
9186 __pyx_t_41 = __pyx_v_eN;
9187 __pyx_t_42 = __pyx_v_ebN;
9188 __pyx_t_43 = __pyx_v_I;
9190 if (__pyx_t_41 < 0) {
9191 __pyx_t_41 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9192 if (unlikely(__pyx_t_41 < 0)) __pyx_t_23 = 0;
9193 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_23 = 0;
9194 if (__pyx_t_42 < 0) {
9195 __pyx_t_42 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9196 if (unlikely(__pyx_t_42 < 0)) __pyx_t_23 = 1;
9197 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_23 = 1;
9198 if (__pyx_t_43 < 0) {
9199 __pyx_t_43 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9200 if (unlikely(__pyx_t_43 < 0)) __pyx_t_23 = 2;
9201 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_23 = 2;
9202 if (unlikely(__pyx_t_23 != -1)) {
9203 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9204 __PYX_ERR(0, 352, __pyx_L1_error)
9206 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_42, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_43, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
9215 __pyx_t_44 = (__pyx_v_I + 1);
9217 if (__pyx_t_44 < 0) {
9218 __pyx_t_44 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9219 if (unlikely(__pyx_t_44 < 0)) __pyx_t_23 = 0;
9220 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_23 = 0;
9221 if (unlikely(__pyx_t_23 != -1)) {
9222 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9223 __PYX_ERR(0, 353, __pyx_L1_error)
9225 __pyx_t_45 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rowptr.diminfo[0].strides));
9226 __pyx_t_46 = __pyx_v_I;
9228 if (__pyx_t_46 < 0) {
9229 __pyx_t_46 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
9230 if (unlikely(__pyx_t_46 < 0)) __pyx_t_23 = 0;
9231 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_23 = 0;
9232 if (unlikely(__pyx_t_23 != -1)) {
9233 __Pyx_RaiseBufferIndexError(__pyx_t_23);
9234 __PYX_ERR(0, 353, __pyx_L1_error)
9236 for (__pyx_t_23 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_23 < __pyx_t_45; __pyx_t_23+=1) {
9237 __pyx_v_ii = __pyx_t_23;
9246 __pyx_t_47 = __pyx_v_ii;
9248 if (__pyx_t_47 < 0) {
9249 __pyx_t_47 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
9250 if (unlikely(__pyx_t_47 < 0)) __pyx_t_48 = 0;
9251 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_48 = 0;
9252 if (unlikely(__pyx_t_48 != -1)) {
9253 __Pyx_RaiseBufferIndexError(__pyx_t_48);
9254 __PYX_ERR(0, 354, __pyx_L1_error)
9256 __pyx_t_49 = __pyx_v_ii;
9258 if (__pyx_t_49 < 0) {
9259 __pyx_t_49 += __pyx_pybuffernd_colind.diminfo[0].shape;
9260 if (unlikely(__pyx_t_49 < 0)) __pyx_t_48 = 0;
9261 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_48 = 0;
9262 if (unlikely(__pyx_t_48 != -1)) {
9263 __Pyx_RaiseBufferIndexError(__pyx_t_48);
9264 __PYX_ERR(0, 354, __pyx_L1_error)
9266 __pyx_t_50 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_colind.diminfo[0].strides));
9268 if (__pyx_t_50 < 0) {
9269 __pyx_t_50 += __pyx_pybuffernd_gravity.diminfo[0].shape;
9270 if (unlikely(__pyx_t_50 < 0)) __pyx_t_48 = 0;
9271 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_48 = 0;
9272 if (unlikely(__pyx_t_48 != -1)) {
9273 __Pyx_RaiseBufferIndexError(__pyx_t_48);
9274 __PYX_ERR(0, 354, __pyx_L1_error)
9276 __pyx_t_51 = __pyx_v_eN;
9277 __pyx_t_52 = __pyx_v_ebN;
9278 __pyx_t_53 = __pyx_v_I;
9280 if (__pyx_t_51 < 0) {
9281 __pyx_t_51 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
9282 if (unlikely(__pyx_t_51 < 0)) __pyx_t_48 = 0;
9283 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_48 = 0;
9284 if (__pyx_t_52 < 0) {
9285 __pyx_t_52 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
9286 if (unlikely(__pyx_t_52 < 0)) __pyx_t_48 = 1;
9287 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_48 = 1;
9288 if (__pyx_t_53 < 0) {
9289 __pyx_t_53 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
9290 if (unlikely(__pyx_t_53 < 0)) __pyx_t_48 = 2;
9291 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_48 = 2;
9292 if (unlikely(__pyx_t_48 != -1)) {
9293 __Pyx_RaiseBufferIndexError(__pyx_t_48);
9294 __PYX_ERR(0, 354, __pyx_L1_error)
9296 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_gravity.diminfo[0].strides)));
9311 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9314 __Pyx_XDECREF(__pyx_t_3);
9315 __Pyx_XDECREF(__pyx_t_4);
9316 __Pyx_XDECREF(__pyx_t_5);
9317 __Pyx_XDECREF(__pyx_t_6);
9318 __Pyx_XDECREF(__pyx_t_7);
9319 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9320 __Pyx_PyThreadState_declare
9321 __Pyx_PyThreadState_assign
9322 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9323 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9324 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9325 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9326 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9327 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9328 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9329 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9330 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9331 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9332 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9333 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9334 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9335 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
9339 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
9340 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
9341 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
9342 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
9343 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
9344 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
9345 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
9346 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
9347 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
9348 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
9349 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
9351 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
9352 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
9353 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
9354 __Pyx_XGIVEREF(__pyx_r);
9355 __Pyx_RefNannyFinishContext();
9368 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9369 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
9370 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
9371 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9373 double __pyx_v_beta;
9374 PyArrayObject *__pyx_v_gravity = 0;
9375 PyArrayObject *__pyx_v_alpha = 0;
9376 PyArrayObject *__pyx_v_n = 0;
9377 PyArrayObject *__pyx_v_thetaR = 0;
9378 PyArrayObject *__pyx_v_thetaSR = 0;
9380 int __pyx_v_nElements_global;
9381 int __pyx_v_nElementBoundaries_element;
9382 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
9383 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
9384 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
9385 int __pyx_v_nDOF_trial_element;
9386 PyArrayObject *__pyx_v_u_l2g = 0;
9387 PyArrayObject *__pyx_v_u_dof = 0;
9388 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
9389 PyArrayObject *__pyx_v_q_u = 0;
9390 PyArrayObject *__pyx_v_q_mass = 0;
9391 PyArrayObject *__pyx_v_q_dmass = 0;
9392 PyArrayObject *__pyx_v_q_r = 0;
9393 PyArrayObject *__pyx_v_q_kr = 0;
9394 PyArrayObject *__pyx_v_q_dkr = 0;
9395 PyArrayObject *__pyx_v_q_kr_up = 0;
9396 PyObject *__pyx_r = 0;
9397 __Pyx_RefNannyDeclarations
9398 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
9400 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
9401 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
9402 if (unlikely(__pyx_kwds)) {
9404 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9406 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9407 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9408 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9409 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9410 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9411 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9412 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9413 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9414 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9415 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9416 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9417 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9418 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9419 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9420 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9421 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9422 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9423 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9424 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9425 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9426 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9427 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9428 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9429 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9431 default:
goto __pyx_L5_argtuple_error;
9433 kw_args = PyDict_Size(__pyx_kwds);
9436 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
9437 else goto __pyx_L5_argtuple_error;
9439 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
9441 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); __PYX_ERR(0, 359, __pyx_L3_error)
9444 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
9446 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); __PYX_ERR(0, 359, __pyx_L3_error)
9449 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
9451 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); __PYX_ERR(0, 359, __pyx_L3_error)
9454 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
9456 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); __PYX_ERR(0, 359, __pyx_L3_error)
9459 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
9461 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); __PYX_ERR(0, 359, __pyx_L3_error)
9464 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
9466 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); __PYX_ERR(0, 359, __pyx_L3_error)
9469 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
9471 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); __PYX_ERR(0, 359, __pyx_L3_error)
9474 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
9476 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); __PYX_ERR(0, 359, __pyx_L3_error)
9479 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
9481 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); __PYX_ERR(0, 359, __pyx_L3_error)
9484 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
9486 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); __PYX_ERR(0, 359, __pyx_L3_error)
9489 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
9491 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); __PYX_ERR(0, 359, __pyx_L3_error)
9494 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
9496 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); __PYX_ERR(0, 359, __pyx_L3_error)
9499 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
9501 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); __PYX_ERR(0, 359, __pyx_L3_error)
9504 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
9506 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); __PYX_ERR(0, 359, __pyx_L3_error)
9509 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
9511 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); __PYX_ERR(0, 359, __pyx_L3_error)
9514 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
9516 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); __PYX_ERR(0, 359, __pyx_L3_error)
9519 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
9521 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); __PYX_ERR(0, 359, __pyx_L3_error)
9524 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
9526 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); __PYX_ERR(0, 359, __pyx_L3_error)
9529 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
9531 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); __PYX_ERR(0, 359, __pyx_L3_error)
9534 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
9536 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); __PYX_ERR(0, 359, __pyx_L3_error)
9539 if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
9541 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); __PYX_ERR(0, 359, __pyx_L3_error)
9544 if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
9546 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); __PYX_ERR(0, 359, __pyx_L3_error)
9549 if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
9551 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); __PYX_ERR(0, 359, __pyx_L3_error)
9554 if (unlikely(kw_args > 0)) {
9555 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) __PYX_ERR(0, 359, __pyx_L3_error)
9557 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
9558 goto __pyx_L5_argtuple_error;
9560 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9561 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9562 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9563 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9564 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9565 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
9566 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
9567 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
9568 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
9569 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
9570 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
9571 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
9572 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
9573 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
9574 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
9575 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
9576 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
9577 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
9578 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
9579 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
9580 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
9581 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
9582 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
9583 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
9585 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error)
9586 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error)
9587 __pyx_v_gravity = ((PyArrayObject *)values[2]);
9588 __pyx_v_alpha = ((PyArrayObject *)values[3]);
9589 __pyx_v_n = ((PyArrayObject *)values[4]);
9590 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
9591 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
9592 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L3_error)
9593 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
9594 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error)
9595 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
9596 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
9597 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
9598 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L3_error)
9599 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
9600 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
9601 __pyx_v_q_x = ((PyArrayObject *)values[16]);
9602 __pyx_v_q_u = ((PyArrayObject *)values[17]);
9603 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
9604 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
9605 __pyx_v_q_r = ((PyArrayObject *)values[20]);
9606 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
9607 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
9608 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
9610 goto __pyx_L4_argument_unpacking_done;
9611 __pyx_L5_argtuple_error:;
9612 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 359, __pyx_L3_error)
9614 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
9615 __Pyx_RefNannyFinishContext();
9617 __pyx_L4_argument_unpacking_done:;
9618 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 361, __pyx_L1_error)
9619 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) __PYX_ERR(0, 362, __pyx_L1_error)
9620 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 363, __pyx_L1_error)
9621 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) __PYX_ERR(0, 364, __pyx_L1_error)
9622 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) __PYX_ERR(0, 365, __pyx_L1_error)
9623 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 370, __pyx_L1_error)
9624 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 371, __pyx_L1_error)
9625 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) __PYX_ERR(0, 372, __pyx_L1_error)
9626 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) __PYX_ERR(0, 375, __pyx_L1_error)
9627 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) __PYX_ERR(0, 376, __pyx_L1_error)
9628 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) __PYX_ERR(0, 378, __pyx_L1_error)
9629 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 379, __pyx_L1_error)
9630 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) __PYX_ERR(0, 380, __pyx_L1_error)
9631 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) __PYX_ERR(0, 381, __pyx_L1_error)
9632 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 382, __pyx_L1_error)
9633 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 383, __pyx_L1_error)
9634 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 384, __pyx_L1_error)
9635 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 385, __pyx_L1_error)
9636 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
9643 __Pyx_RefNannyFinishContext();
9647 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
9648 PyObject *__pyx_v_q = NULL;
9649 double __pyx_v_psiC;
9650 double __pyx_v_pcBar;
9651 double __pyx_v_pcBar_n;
9652 double __pyx_v_pcBar_nM1;
9653 double __pyx_v_pcBar_nM2;
9654 double __pyx_v_onePlus_pcBar_n;
9655 double __pyx_v_sBar;
9656 double __pyx_v_sqrt_sBar;
9657 double __pyx_v_DsBar_DpsiC;
9658 double __pyx_v_thetaW;
9659 double __pyx_v_DthetaW_DpsiC;
9660 double __pyx_v_vBar;
9661 double __pyx_v_vBar2;
9662 double __pyx_v_DvBar_DpsiC;
9664 double __pyx_v_DKWr_DpsiC;
9665 CYTHON_UNUSED
double __pyx_v_rho2;
9666 double __pyx_v_thetaS;
9667 double __pyx_v_rhom;
9668 double __pyx_v_drhom;
9671 double __pyx_v_u_eN;
9672 double __pyx_v_u_neig;
9673 double __pyx_v_kr_eN;
9674 double __pyx_v_kr_neig;
9675 double __pyx_v_phi_eN;
9676 double __pyx_v_phi_neig;
9678 int __pyx_v_eN_neighbor;
9682 double __pyx_v_nAvgWeight;
9683 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
9684 __Pyx_Buffer __pyx_pybuffer_alpha;
9685 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
9686 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
9687 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
9688 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
9689 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
9690 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
9691 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
9692 __Pyx_Buffer __pyx_pybuffer_gravity;
9693 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
9694 __Pyx_Buffer __pyx_pybuffer_n;
9695 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
9696 __Pyx_Buffer __pyx_pybuffer_q_dkr;
9697 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
9698 __Pyx_Buffer __pyx_pybuffer_q_dmass;
9699 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
9700 __Pyx_Buffer __pyx_pybuffer_q_kr;
9701 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
9702 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
9703 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
9704 __Pyx_Buffer __pyx_pybuffer_q_mass;
9705 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
9706 __Pyx_Buffer __pyx_pybuffer_q_r;
9707 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
9708 __Pyx_Buffer __pyx_pybuffer_q_u;
9709 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
9710 __Pyx_Buffer __pyx_pybuffer_q_x;
9711 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
9712 __Pyx_Buffer __pyx_pybuffer_thetaR;
9713 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
9714 __Pyx_Buffer __pyx_pybuffer_thetaSR;
9715 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
9716 __Pyx_Buffer __pyx_pybuffer_u_dof;
9717 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
9718 __Pyx_Buffer __pyx_pybuffer_u_l2g;
9719 PyObject *__pyx_r = NULL;
9720 __Pyx_RefNannyDeclarations
9721 PyObject *__pyx_t_1 = NULL;
9722 PyObject *__pyx_t_2 = NULL;
9723 Py_ssize_t __pyx_t_3;
9724 PyObject *__pyx_t_4 = NULL;
9725 PyObject *__pyx_t_5 = NULL;
9730 Py_ssize_t __pyx_t_10;
9733 Py_ssize_t __pyx_t_13;
9734 Py_ssize_t __pyx_t_14;
9736 Py_ssize_t __pyx_t_16;
9737 Py_ssize_t __pyx_t_17;
9738 Py_ssize_t __pyx_t_18;
9739 Py_ssize_t __pyx_t_19;
9740 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
9741 Py_ssize_t __pyx_t_21;
9742 Py_ssize_t __pyx_t_22;
9743 Py_ssize_t __pyx_t_23;
9744 Py_ssize_t __pyx_t_24;
9745 Py_ssize_t __pyx_t_25;
9746 Py_ssize_t __pyx_t_26;
9747 Py_ssize_t __pyx_t_27;
9748 Py_ssize_t __pyx_t_28;
9749 Py_ssize_t __pyx_t_29;
9750 Py_ssize_t __pyx_t_30;
9751 Py_ssize_t __pyx_t_31;
9752 Py_ssize_t __pyx_t_32;
9753 Py_ssize_t __pyx_t_33;
9754 Py_ssize_t __pyx_t_34;
9755 Py_ssize_t __pyx_t_35;
9756 Py_ssize_t __pyx_t_36;
9757 Py_ssize_t __pyx_t_37;
9758 Py_ssize_t __pyx_t_38;
9759 Py_ssize_t __pyx_t_39;
9760 PyObject *__pyx_t_40 = NULL;
9761 PyObject *__pyx_t_41 = NULL;
9762 Py_ssize_t __pyx_t_42;
9763 Py_ssize_t __pyx_t_43;
9764 Py_ssize_t __pyx_t_44;
9765 Py_ssize_t __pyx_t_45;
9766 Py_ssize_t __pyx_t_46;
9767 Py_ssize_t __pyx_t_47;
9768 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
9769 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
9770 __pyx_pybuffer_gravity.refcount = 0;
9771 __pyx_pybuffernd_gravity.data = NULL;
9772 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
9773 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
9774 __pyx_pybuffer_alpha.refcount = 0;
9775 __pyx_pybuffernd_alpha.data = NULL;
9776 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
9777 __pyx_pybuffer_n.pybuffer.buf = NULL;
9778 __pyx_pybuffer_n.refcount = 0;
9779 __pyx_pybuffernd_n.data = NULL;
9780 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
9781 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
9782 __pyx_pybuffer_thetaR.refcount = 0;
9783 __pyx_pybuffernd_thetaR.data = NULL;
9784 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
9785 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
9786 __pyx_pybuffer_thetaSR.refcount = 0;
9787 __pyx_pybuffernd_thetaSR.data = NULL;
9788 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
9789 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
9790 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9791 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9792 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9793 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
9794 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
9795 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
9796 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
9797 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9798 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9799 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9800 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9801 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
9802 __pyx_pybuffer_u_l2g.refcount = 0;
9803 __pyx_pybuffernd_u_l2g.data = NULL;
9804 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
9805 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
9806 __pyx_pybuffer_u_dof.refcount = 0;
9807 __pyx_pybuffernd_u_dof.data = NULL;
9808 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
9809 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
9810 __pyx_pybuffer_q_x.refcount = 0;
9811 __pyx_pybuffernd_q_x.data = NULL;
9812 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
9813 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
9814 __pyx_pybuffer_q_u.refcount = 0;
9815 __pyx_pybuffernd_q_u.data = NULL;
9816 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
9817 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
9818 __pyx_pybuffer_q_mass.refcount = 0;
9819 __pyx_pybuffernd_q_mass.data = NULL;
9820 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
9821 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
9822 __pyx_pybuffer_q_dmass.refcount = 0;
9823 __pyx_pybuffernd_q_dmass.data = NULL;
9824 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
9825 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
9826 __pyx_pybuffer_q_r.refcount = 0;
9827 __pyx_pybuffernd_q_r.data = NULL;
9828 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
9829 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
9830 __pyx_pybuffer_q_kr.refcount = 0;
9831 __pyx_pybuffernd_q_kr.data = NULL;
9832 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
9833 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
9834 __pyx_pybuffer_q_dkr.refcount = 0;
9835 __pyx_pybuffernd_q_dkr.data = NULL;
9836 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
9837 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
9838 __pyx_pybuffer_q_kr_up.refcount = 0;
9839 __pyx_pybuffernd_q_kr_up.data = NULL;
9840 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
9842 __Pyx_BufFmt_StackElem __pyx_stack[1];
9843 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9845 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9847 __Pyx_BufFmt_StackElem __pyx_stack[1];
9848 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9850 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
9852 __Pyx_BufFmt_StackElem __pyx_stack[1];
9853 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9855 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
9857 __Pyx_BufFmt_StackElem __pyx_stack[1];
9858 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9860 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
9862 __Pyx_BufFmt_StackElem __pyx_stack[1];
9863 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9865 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
9867 __Pyx_BufFmt_StackElem __pyx_stack[1];
9868 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9870 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9872 __Pyx_BufFmt_StackElem __pyx_stack[1];
9873 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9875 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
9877 __Pyx_BufFmt_StackElem __pyx_stack[1];
9878 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9880 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9882 __Pyx_BufFmt_StackElem __pyx_stack[1];
9883 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9885 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
9887 __Pyx_BufFmt_StackElem __pyx_stack[1];
9888 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9890 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
9892 __Pyx_BufFmt_StackElem __pyx_stack[1];
9893 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9895 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
9897 __Pyx_BufFmt_StackElem __pyx_stack[1];
9898 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9900 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
9902 __Pyx_BufFmt_StackElem __pyx_stack[1];
9903 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9905 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
9907 __Pyx_BufFmt_StackElem __pyx_stack[1];
9908 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9910 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
9912 __Pyx_BufFmt_StackElem __pyx_stack[1];
9913 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9915 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
9917 __Pyx_BufFmt_StackElem __pyx_stack[1];
9918 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9920 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
9922 __Pyx_BufFmt_StackElem __pyx_stack[1];
9923 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9925 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
9927 __Pyx_BufFmt_StackElem __pyx_stack[1];
9928 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 359, __pyx_L1_error)
9930 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
9939 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
9940 __Pyx_GOTREF(__pyx_t_1);
9941 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
9942 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
9943 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
9944 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
9945 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
9946 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
9947 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
9948 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
9949 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
9950 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
9951 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
9952 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
9953 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
9954 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
9955 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
9956 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9959 if (__pyx_t_3 >= 5)
break;
9960 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 9961 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
9963 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
9964 __Pyx_GOTREF(__pyx_t_1);
9966 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
9976 #ifndef CYTHON_WITHOUT_ASSERTIONS 9977 if (unlikely(!Py_OptimizeFlag)) {
9978 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
9979 __Pyx_GOTREF(__pyx_t_1);
9980 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
9981 __Pyx_GOTREF(__pyx_t_4);
9982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9983 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
9984 __Pyx_GOTREF(__pyx_t_1);
9985 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
9986 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9987 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9988 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
9989 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9990 if (unlikely(!__pyx_t_6)) {
9991 PyErr_SetNone(PyExc_AssertionError);
9992 __PYX_ERR(0, 400, __pyx_L1_error)
10005 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10014 #ifndef CYTHON_WITHOUT_ASSERTIONS 10015 if (unlikely(!Py_OptimizeFlag)) {
10016 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
10017 PyErr_SetNone(PyExc_AssertionError);
10018 __PYX_ERR(0, 401, __pyx_L1_error)
10030 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
10039 __pyx_t_7 = (__pyx_v_nSpace + 1.);
10040 if (unlikely(__pyx_t_7 == 0)) {
10041 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10042 __PYX_ERR(0, 409, __pyx_L1_error)
10044 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
10053 __pyx_t_8 = __pyx_v_nElements_global;
10054 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10055 __pyx_v_eN = __pyx_t_9;
10064 __pyx_t_10 = __pyx_v_eN;
10066 if (__pyx_t_10 < 0) {
10067 __pyx_t_10 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
10068 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
10069 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_11 = 0;
10070 if (unlikely(__pyx_t_11 != -1)) {
10071 __Pyx_RaiseBufferIndexError(__pyx_t_11);
10072 __PYX_ERR(0, 413, __pyx_L1_error)
10074 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
10083 __pyx_t_11 = __pyx_v_nDOF_trial_element;
10084 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
10085 __pyx_v_j = __pyx_t_12;
10094 __pyx_t_13 = __pyx_v_eN;
10095 __pyx_t_14 = __pyx_v_j;
10097 if (__pyx_t_13 < 0) {
10098 __pyx_t_13 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
10099 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 0;
10100 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_15 = 0;
10101 if (__pyx_t_14 < 0) {
10102 __pyx_t_14 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
10103 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
10104 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_15 = 1;
10105 if (unlikely(__pyx_t_15 != -1)) {
10106 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10107 __PYX_ERR(0, 415, __pyx_L1_error)
10109 __pyx_t_16 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
10111 if (__pyx_t_16 < 0) {
10112 __pyx_t_16 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
10113 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
10114 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_15 = 0;
10115 if (unlikely(__pyx_t_15 != -1)) {
10116 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10117 __PYX_ERR(0, 415, __pyx_L1_error)
10119 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_u_dof.diminfo[0].strides));
10128 __pyx_t_17 = __pyx_v_eN;
10129 __pyx_t_18 = __pyx_v_j;
10131 if (__pyx_t_17 < 0) {
10132 __pyx_t_17 += __pyx_pybuffernd_q_u.diminfo[0].shape;
10133 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
10134 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_15 = 0;
10135 if (__pyx_t_18 < 0) {
10136 __pyx_t_18 += __pyx_pybuffernd_q_u.diminfo[1].shape;
10137 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
10138 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_15 = 1;
10139 if (unlikely(__pyx_t_15 != -1)) {
10140 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10141 __PYX_ERR(0, 416, __pyx_L1_error)
10143 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
10152 __pyx_v_psiC = (-__pyx_v_u_j);
10161 __pyx_t_19 = __pyx_v_matID;
10163 if (__pyx_t_19 < 0) {
10164 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[0].shape;
10165 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
10166 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
10167 if (unlikely(__pyx_t_15 != -1)) {
10168 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10169 __PYX_ERR(0, 420, __pyx_L1_error)
10171 __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_n.diminfo[0].strides));
10172 if (unlikely(__pyx_t_20 == 0)) {
10173 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10174 __PYX_ERR(0, 420, __pyx_L1_error)
10176 __pyx_v_m = (1.0 - (1.0 / __pyx_t_20));
10185 __pyx_t_21 = __pyx_v_matID;
10187 if (__pyx_t_21 < 0) {
10188 __pyx_t_21 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10189 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 0;
10190 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
10191 if (unlikely(__pyx_t_15 != -1)) {
10192 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10193 __PYX_ERR(0, 421, __pyx_L1_error)
10195 __pyx_t_22 = __pyx_v_matID;
10197 if (__pyx_t_22 < 0) {
10198 __pyx_t_22 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10199 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 0;
10200 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
10201 if (unlikely(__pyx_t_15 != -1)) {
10202 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10203 __PYX_ERR(0, 421, __pyx_L1_error)
10205 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
10214 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
10224 __pyx_t_23 = __pyx_v_matID;
10226 if (__pyx_t_23 < 0) {
10227 __pyx_t_23 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10228 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 0;
10229 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
10230 if (unlikely(__pyx_t_15 != -1)) {
10231 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10232 __PYX_ERR(0, 423, __pyx_L1_error)
10234 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
10243 __pyx_t_24 = __pyx_v_matID;
10245 if (__pyx_t_24 < 0) {
10246 __pyx_t_24 += __pyx_pybuffernd_n.diminfo[0].shape;
10247 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
10248 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
10249 if (unlikely(__pyx_t_15 != -1)) {
10250 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10251 __PYX_ERR(0, 424, __pyx_L1_error)
10253 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
10262 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
10271 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
10280 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
10289 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
10298 __pyx_t_25 = __pyx_v_matID;
10300 if (__pyx_t_25 < 0) {
10301 __pyx_t_25 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10302 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 0;
10303 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
10304 if (unlikely(__pyx_t_15 != -1)) {
10305 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10306 __PYX_ERR(0, 431, __pyx_L1_error)
10308 __pyx_t_26 = __pyx_v_matID;
10310 if (__pyx_t_26 < 0) {
10311 __pyx_t_26 += __pyx_pybuffernd_n.diminfo[0].shape;
10312 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 0;
10313 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
10314 if (unlikely(__pyx_t_15 != -1)) {
10315 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10316 __PYX_ERR(0, 431, __pyx_L1_error)
10318 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
10319 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10320 __PYX_ERR(0, 431, __pyx_L1_error)
10322 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
10331 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
10340 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
10349 __pyx_t_27 = __pyx_v_matID;
10351 if (__pyx_t_27 < 0) {
10352 __pyx_t_27 += __pyx_pybuffernd_alpha.diminfo[0].shape;
10353 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 0;
10354 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
10355 if (unlikely(__pyx_t_15 != -1)) {
10356 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10357 __PYX_ERR(0, 435, __pyx_L1_error)
10359 __pyx_t_28 = __pyx_v_matID;
10361 if (__pyx_t_28 < 0) {
10362 __pyx_t_28 += __pyx_pybuffernd_n.diminfo[0].shape;
10363 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
10364 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
10365 if (unlikely(__pyx_t_15 != -1)) {
10366 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10367 __PYX_ERR(0, 435, __pyx_L1_error)
10369 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
10378 __pyx_t_29 = __pyx_v_matID;
10380 if (__pyx_t_29 < 0) {
10381 __pyx_t_29 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10382 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 0;
10383 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
10384 if (unlikely(__pyx_t_15 != -1)) {
10385 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10386 __PYX_ERR(0, 437, __pyx_L1_error)
10388 __pyx_t_30 = __pyx_v_matID;
10390 if (__pyx_t_30 < 0) {
10391 __pyx_t_30 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
10392 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 0;
10393 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
10394 if (unlikely(__pyx_t_15 != -1)) {
10395 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10396 __PYX_ERR(0, 437, __pyx_L1_error)
10398 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
10407 __pyx_t_31 = __pyx_v_matID;
10409 if (__pyx_t_31 < 0) {
10410 __pyx_t_31 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
10411 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 0;
10412 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
10413 if (unlikely(__pyx_t_15 != -1)) {
10414 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10415 __PYX_ERR(0, 438, __pyx_L1_error)
10417 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
10426 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
10435 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
10444 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
10445 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
10446 __PYX_ERR(0, 442, __pyx_L1_error)
10448 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
10468 __pyx_v_thetaW = __pyx_v_thetaS;
10477 __pyx_v_DthetaW_DpsiC = 0.0;
10495 __pyx_v_DKWr_DpsiC = 0.0;
10506 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
10515 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
10524 __pyx_t_32 = __pyx_v_eN;
10525 __pyx_t_33 = __pyx_v_j;
10527 if (__pyx_t_32 < 0) {
10528 __pyx_t_32 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
10529 if (unlikely(__pyx_t_32 < 0)) __pyx_t_15 = 0;
10530 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_15 = 0;
10531 if (__pyx_t_33 < 0) {
10532 __pyx_t_33 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
10533 if (unlikely(__pyx_t_33 < 0)) __pyx_t_15 = 1;
10534 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_15 = 1;
10535 if (unlikely(__pyx_t_15 != -1)) {
10536 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10537 __PYX_ERR(0, 451, __pyx_L1_error)
10539 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
10548 __pyx_t_34 = __pyx_v_eN;
10549 __pyx_t_35 = __pyx_v_j;
10551 if (__pyx_t_34 < 0) {
10552 __pyx_t_34 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
10553 if (unlikely(__pyx_t_34 < 0)) __pyx_t_15 = 0;
10554 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_15 = 0;
10555 if (__pyx_t_35 < 0) {
10556 __pyx_t_35 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
10557 if (unlikely(__pyx_t_35 < 0)) __pyx_t_15 = 1;
10558 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_15 = 1;
10559 if (unlikely(__pyx_t_15 != -1)) {
10560 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10561 __PYX_ERR(0, 452, __pyx_L1_error)
10563 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
10572 __pyx_t_36 = __pyx_v_eN;
10573 __pyx_t_37 = __pyx_v_j;
10575 if (__pyx_t_36 < 0) {
10576 __pyx_t_36 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
10577 if (unlikely(__pyx_t_36 < 0)) __pyx_t_15 = 0;
10578 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_15 = 0;
10579 if (__pyx_t_37 < 0) {
10580 __pyx_t_37 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
10581 if (unlikely(__pyx_t_37 < 0)) __pyx_t_15 = 1;
10582 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_15 = 1;
10583 if (unlikely(__pyx_t_15 != -1)) {
10584 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10585 __PYX_ERR(0, 454, __pyx_L1_error)
10587 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
10596 __pyx_t_38 = __pyx_v_eN;
10597 __pyx_t_39 = __pyx_v_j;
10599 if (__pyx_t_38 < 0) {
10600 __pyx_t_38 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
10601 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
10602 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_15 = 0;
10603 if (__pyx_t_39 < 0) {
10604 __pyx_t_39 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
10605 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
10606 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_15 = 1;
10607 if (unlikely(__pyx_t_15 != -1)) {
10608 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10609 __PYX_ERR(0, 455, __pyx_L1_error)
10611 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
10622 __pyx_t_8 = __pyx_v_nElements_global;
10623 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10624 __pyx_v_eN = __pyx_t_9;
10633 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
10634 __Pyx_GOTREF(__pyx_t_5);
10635 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
10636 __Pyx_GOTREF(__pyx_t_1);
10637 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10638 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
10639 __Pyx_GOTREF(__pyx_t_5);
10641 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10642 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
10643 if (likely(__pyx_t_4)) {
10644 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10645 __Pyx_INCREF(__pyx_t_4);
10646 __Pyx_INCREF(
function);
10647 __Pyx_DECREF_SET(__pyx_t_1,
function);
10651 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
10652 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10653 __Pyx_GOTREF(__pyx_t_2);
10655 #if CYTHON_FAST_PYCALL 10656 if (PyFunction_Check(__pyx_t_1)) {
10657 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
10658 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
10659 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10660 __Pyx_GOTREF(__pyx_t_2);
10661 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10664 #if CYTHON_FAST_PYCCALL 10665 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10666 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
10667 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
10668 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10669 __Pyx_GOTREF(__pyx_t_2);
10670 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10674 __pyx_t_40 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 462, __pyx_L1_error)
10675 __Pyx_GOTREF(__pyx_t_40);
10676 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_4); __pyx_t_4 = NULL;
10677 __Pyx_GIVEREF(__pyx_t_5);
10678 PyTuple_SET_ITEM(__pyx_t_40, 0+1, __pyx_t_5);
10680 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_40, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
10681 __Pyx_GOTREF(__pyx_t_2);
10682 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10686 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
10687 __Pyx_GOTREF(__pyx_t_1);
10688 __pyx_t_40 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 462, __pyx_L1_error)
10689 __Pyx_GOTREF(__pyx_t_40);
10690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10691 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10692 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_40);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
10693 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10694 __pyx_v_u_eN = __pyx_t_7;
10703 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
10704 __Pyx_GOTREF(__pyx_t_1);
10705 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
10706 __Pyx_GOTREF(__pyx_t_2);
10707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10708 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
10709 __Pyx_GOTREF(__pyx_t_1);
10711 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10712 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10713 if (likely(__pyx_t_5)) {
10714 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
10715 __Pyx_INCREF(__pyx_t_5);
10716 __Pyx_INCREF(
function);
10717 __Pyx_DECREF_SET(__pyx_t_2,
function);
10721 __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 463, __pyx_L1_error)
10722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10723 __Pyx_GOTREF(__pyx_t_40);
10725 #if CYTHON_FAST_PYCALL 10726 if (PyFunction_Check(__pyx_t_2)) {
10727 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
10728 __pyx_t_40 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 463, __pyx_L1_error)
10729 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10730 __Pyx_GOTREF(__pyx_t_40);
10731 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10734 #if CYTHON_FAST_PYCCALL 10735 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
10736 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_1};
10737 __pyx_t_40 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 463, __pyx_L1_error)
10738 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10739 __Pyx_GOTREF(__pyx_t_40);
10740 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10744 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
10745 __Pyx_GOTREF(__pyx_t_4);
10746 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
10747 __Pyx_GIVEREF(__pyx_t_1);
10748 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
10750 __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 463, __pyx_L1_error)
10751 __Pyx_GOTREF(__pyx_t_40);
10752 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10755 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10756 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
10757 __Pyx_GOTREF(__pyx_t_2);
10758 __pyx_t_4 = PyNumber_Multiply(__pyx_t_40, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error)
10759 __Pyx_GOTREF(__pyx_t_4);
10760 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10761 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10762 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
10763 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10764 __pyx_v_kr_eN = __pyx_t_7;
10773 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
10774 __Pyx_GOTREF(__pyx_t_4);
10775 __pyx_t_40 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 465, __pyx_L1_error)
10776 __Pyx_GOTREF(__pyx_t_40);
10777 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_dot);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
10778 __Pyx_GOTREF(__pyx_t_1);
10779 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10780 __pyx_t_40 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 465, __pyx_L1_error)
10781 __Pyx_GOTREF(__pyx_t_40);
10784 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10785 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10786 if (likely(__pyx_t_5)) {
10787 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10788 __Pyx_INCREF(__pyx_t_5);
10789 __Pyx_INCREF(
function);
10790 __Pyx_DECREF_SET(__pyx_t_1,
function);
10794 #if CYTHON_FAST_PYCALL 10795 if (PyFunction_Check(__pyx_t_1)) {
10796 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_40};
10797 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
10798 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10799 __Pyx_GOTREF(__pyx_t_2);
10800 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10803 #if CYTHON_FAST_PYCCALL 10804 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
10805 PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_gravity), __pyx_t_40};
10806 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
10807 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10808 __Pyx_GOTREF(__pyx_t_2);
10809 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10813 __pyx_t_41 = PyTuple_New(2+__pyx_t_11);
if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 465, __pyx_L1_error)
10814 __Pyx_GOTREF(__pyx_t_41);
10816 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_5); __pyx_t_5 = NULL;
10818 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
10819 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
10820 PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_11, ((PyObject *)__pyx_v_gravity));
10821 __Pyx_GIVEREF(__pyx_t_40);
10822 PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_11, __pyx_t_40);
10824 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_41, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
10825 __Pyx_GOTREF(__pyx_t_2);
10826 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
10828 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10829 __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
10830 __Pyx_GOTREF(__pyx_t_1);
10831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10832 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10833 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
10834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10835 __pyx_v_phi_eN = __pyx_t_7;
10844 __pyx_t_11 = __pyx_v_nElementBoundaries_element;
10845 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
10846 __pyx_v_ebN = __pyx_t_12;
10855 __pyx_t_42 = __pyx_v_eN;
10856 __pyx_t_43 = __pyx_v_ebN;
10858 if (__pyx_t_42 < 0) {
10859 __pyx_t_42 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
10860 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
10861 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
10862 if (__pyx_t_43 < 0) {
10863 __pyx_t_43 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
10864 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
10865 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
10866 if (unlikely(__pyx_t_15 != -1)) {
10867 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10868 __PYX_ERR(0, 471, __pyx_L1_error)
10870 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
10879 __pyx_t_44 = __pyx_v_eN;
10880 __pyx_t_45 = __pyx_v_ebN;
10882 if (__pyx_t_44 < 0) {
10883 __pyx_t_44 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
10884 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 0;
10885 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_15 = 0;
10886 if (__pyx_t_45 < 0) {
10887 __pyx_t_45 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
10888 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 1;
10889 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_15 = 1;
10890 if (unlikely(__pyx_t_15 != -1)) {
10891 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10892 __PYX_ERR(0, 472, __pyx_L1_error)
10894 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
10903 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
10913 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
10914 __Pyx_GOTREF(__pyx_t_2);
10915 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
10916 __Pyx_GOTREF(__pyx_t_4);
10917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10918 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
10919 __Pyx_GOTREF(__pyx_t_2);
10921 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10922 __pyx_t_41 = PyMethod_GET_SELF(__pyx_t_4);
10923 if (likely(__pyx_t_41)) {
10924 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10925 __Pyx_INCREF(__pyx_t_41);
10926 __Pyx_INCREF(
function);
10927 __Pyx_DECREF_SET(__pyx_t_4,
function);
10931 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
10932 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10933 __Pyx_GOTREF(__pyx_t_1);
10935 #if CYTHON_FAST_PYCALL 10936 if (PyFunction_Check(__pyx_t_4)) {
10937 PyObject *__pyx_temp[2] = {__pyx_t_41, __pyx_t_2};
10938 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
10939 __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0;
10940 __Pyx_GOTREF(__pyx_t_1);
10941 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10944 #if CYTHON_FAST_PYCCALL 10945 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
10946 PyObject *__pyx_temp[2] = {__pyx_t_41, __pyx_t_2};
10947 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
10948 __Pyx_XDECREF(__pyx_t_41); __pyx_t_41 = 0;
10949 __Pyx_GOTREF(__pyx_t_1);
10950 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10954 __pyx_t_40 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 474, __pyx_L1_error)
10955 __Pyx_GOTREF(__pyx_t_40);
10956 __Pyx_GIVEREF(__pyx_t_41); PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_41); __pyx_t_41 = NULL;
10957 __Pyx_GIVEREF(__pyx_t_2);
10958 PyTuple_SET_ITEM(__pyx_t_40, 0+1, __pyx_t_2);
10960 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_40, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
10961 __Pyx_GOTREF(__pyx_t_1);
10962 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10965 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10966 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
10967 __Pyx_GOTREF(__pyx_t_4);
10968 __pyx_t_40 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 474, __pyx_L1_error)
10969 __Pyx_GOTREF(__pyx_t_40);
10970 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10971 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10972 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_40);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L1_error)
10973 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10974 __pyx_v_u_neig = __pyx_t_7;
10983 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
10984 __Pyx_GOTREF(__pyx_t_4);
10985 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
10986 __Pyx_GOTREF(__pyx_t_1);
10987 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10988 __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 475, __pyx_L1_error)
10989 __Pyx_GOTREF(__pyx_t_4);
10991 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10992 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
10993 if (likely(__pyx_t_2)) {
10994 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10995 __Pyx_INCREF(__pyx_t_2);
10996 __Pyx_INCREF(
function);
10997 __Pyx_DECREF_SET(__pyx_t_1,
function);
11001 __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 475, __pyx_L1_error)
11002 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11003 __Pyx_GOTREF(__pyx_t_40);
11005 #if CYTHON_FAST_PYCALL 11006 if (PyFunction_Check(__pyx_t_1)) {
11007 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
11008 __pyx_t_40 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 475, __pyx_L1_error)
11009 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11010 __Pyx_GOTREF(__pyx_t_40);
11011 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11014 #if CYTHON_FAST_PYCCALL 11015 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11016 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
11017 __pyx_t_40 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 475, __pyx_L1_error)
11018 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11019 __Pyx_GOTREF(__pyx_t_40);
11020 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11024 __pyx_t_41 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 475, __pyx_L1_error)
11025 __Pyx_GOTREF(__pyx_t_41);
11026 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_2); __pyx_t_2 = NULL;
11027 __Pyx_GIVEREF(__pyx_t_4);
11028 PyTuple_SET_ITEM(__pyx_t_41, 0+1, __pyx_t_4);
11030 __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_41, NULL);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 475, __pyx_L1_error)
11031 __Pyx_GOTREF(__pyx_t_40);
11032 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
11035 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11036 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11037 __Pyx_GOTREF(__pyx_t_1);
11038 __pyx_t_41 = PyNumber_Multiply(__pyx_t_40, __pyx_t_1);
if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 475, __pyx_L1_error)
11039 __Pyx_GOTREF(__pyx_t_41);
11040 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
11041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11042 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_41);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 475, __pyx_L1_error)
11043 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
11044 __pyx_v_kr_neig = __pyx_t_7;
11053 __pyx_t_41 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_41)) __PYX_ERR(0, 477, __pyx_L1_error)
11054 __Pyx_GOTREF(__pyx_t_41);
11055 __pyx_t_40 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 477, __pyx_L1_error)
11056 __Pyx_GOTREF(__pyx_t_40);
11057 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11058 __Pyx_GOTREF(__pyx_t_4);
11059 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
11060 __pyx_t_40 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(!__pyx_t_40)) __PYX_ERR(0, 477, __pyx_L1_error)
11061 __Pyx_GOTREF(__pyx_t_40);
11064 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
11065 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
11066 if (likely(__pyx_t_2)) {
11067 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
11068 __Pyx_INCREF(__pyx_t_2);
11069 __Pyx_INCREF(
function);
11070 __Pyx_DECREF_SET(__pyx_t_4,
function);
11074 #if CYTHON_FAST_PYCALL 11075 if (PyFunction_Check(__pyx_t_4)) {
11076 PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_gravity), __pyx_t_40};
11077 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11078 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11079 __Pyx_GOTREF(__pyx_t_1);
11080 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
11083 #if CYTHON_FAST_PYCCALL 11084 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
11085 PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_gravity), __pyx_t_40};
11086 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_15, 2+__pyx_t_15);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11087 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11088 __Pyx_GOTREF(__pyx_t_1);
11089 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
11093 __pyx_t_5 = PyTuple_New(2+__pyx_t_15);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
11094 __Pyx_GOTREF(__pyx_t_5);
11096 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
11098 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
11099 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
11100 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_15, ((PyObject *)__pyx_v_gravity));
11101 __Pyx_GIVEREF(__pyx_t_40);
11102 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_15, __pyx_t_40);
11104 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11105 __Pyx_GOTREF(__pyx_t_1);
11106 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11108 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11109 __pyx_t_4 = PyNumber_Subtract(__pyx_t_41, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
11110 __Pyx_GOTREF(__pyx_t_4);
11111 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
11112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11113 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
11114 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11115 __pyx_v_phi_neig = __pyx_t_7;
11124 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
11134 __pyx_t_46 = __pyx_v_eN;
11135 __pyx_t_47 = __pyx_v_ebN;
11137 if (__pyx_t_46 < 0) {
11138 __pyx_t_46 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11139 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
11140 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
11141 if (__pyx_t_47 < 0) {
11142 __pyx_t_47 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11143 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
11144 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
11145 if (unlikely(__pyx_t_15 != -1)) {
11146 __Pyx_RaiseBufferIndexError(__pyx_t_15);
11147 __PYX_ERR(0, 480, __pyx_L1_error)
11149 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
11180 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11183 __Pyx_XDECREF(__pyx_t_1);
11184 __Pyx_XDECREF(__pyx_t_2);
11185 __Pyx_XDECREF(__pyx_t_4);
11186 __Pyx_XDECREF(__pyx_t_5);
11187 __Pyx_XDECREF(__pyx_t_40);
11188 __Pyx_XDECREF(__pyx_t_41);
11189 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11190 __Pyx_PyThreadState_declare
11191 __Pyx_PyThreadState_assign
11192 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11193 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11194 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11195 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11196 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11197 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11198 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11199 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11200 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11201 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11202 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11203 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11204 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11205 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11206 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11207 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11208 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11209 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11210 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11211 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11212 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
11216 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
11217 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11218 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
11219 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11220 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11221 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
11222 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
11223 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
11224 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11225 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11226 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
11227 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11228 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11229 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
11230 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
11231 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
11232 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
11233 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
11235 __Pyx_XDECREF(__pyx_v_q);
11236 __Pyx_XGIVEREF(__pyx_r);
11237 __Pyx_RefNannyFinishContext();
11250 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11251 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11252 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
11253 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11254 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11255 PyArrayObject *__pyx_v_rowptr = 0;
11256 PyArrayObject *__pyx_v_colind = 0;
11257 int __pyx_v_nSpace;
11258 int __pyx_v_nElements_global;
11259 int __pyx_v_nElementBoundaries_element;
11260 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11261 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11262 int __pyx_v_nDOF_test_element;
11263 PyArrayObject *__pyx_v_q_u = 0;
11264 PyArrayObject *__pyx_v_q_grad_u = 0;
11265 PyArrayObject *__pyx_v_q_grad_w = 0;
11266 PyArrayObject *__pyx_v_q_detJ = 0;
11267 PyArrayObject *__pyx_v_q_m = 0;
11268 PyArrayObject *__pyx_v_q_mt = 0;
11269 PyArrayObject *__pyx_v_q_r = 0;
11270 PyArrayObject *__pyx_v_q_kr = 0;
11271 PyArrayObject *__pyx_v_q_kr_up = 0;
11272 PyArrayObject *__pyx_v_q_flin = 0;
11273 PyArrayObject *__pyx_v_q_alin = 0;
11274 PyArrayObject *__pyx_v_elementResidual = 0;
11275 PyObject *__pyx_r = 0;
11276 __Pyx_RefNannyDeclarations
11277 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
11279 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
11280 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11281 if (unlikely(__pyx_kwds)) {
11282 Py_ssize_t kw_args;
11283 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11284 switch (pos_args) {
11285 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11286 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11287 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11288 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11289 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11290 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11291 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11292 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11293 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11294 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11295 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11296 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11297 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11298 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11299 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11300 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11301 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11302 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11303 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11304 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11305 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11307 default:
goto __pyx_L5_argtuple_error;
11309 kw_args = PyDict_Size(__pyx_kwds);
11310 switch (pos_args) {
11312 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
11313 else goto __pyx_L5_argtuple_error;
11315 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
11317 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); __PYX_ERR(0, 486, __pyx_L3_error)
11320 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
11322 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); __PYX_ERR(0, 486, __pyx_L3_error)
11325 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
11327 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); __PYX_ERR(0, 486, __pyx_L3_error)
11330 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
11332 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); __PYX_ERR(0, 486, __pyx_L3_error)
11335 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
11337 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); __PYX_ERR(0, 486, __pyx_L3_error)
11340 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
11342 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); __PYX_ERR(0, 486, __pyx_L3_error)
11345 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
11347 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); __PYX_ERR(0, 486, __pyx_L3_error)
11350 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
11352 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); __PYX_ERR(0, 486, __pyx_L3_error)
11355 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
11357 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); __PYX_ERR(0, 486, __pyx_L3_error)
11360 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
11362 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); __PYX_ERR(0, 486, __pyx_L3_error)
11365 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
11367 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); __PYX_ERR(0, 486, __pyx_L3_error)
11370 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
11372 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); __PYX_ERR(0, 486, __pyx_L3_error)
11375 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
11377 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); __PYX_ERR(0, 486, __pyx_L3_error)
11380 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
11382 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); __PYX_ERR(0, 486, __pyx_L3_error)
11385 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
11387 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); __PYX_ERR(0, 486, __pyx_L3_error)
11390 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
11392 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); __PYX_ERR(0, 486, __pyx_L3_error)
11395 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
11397 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); __PYX_ERR(0, 486, __pyx_L3_error)
11400 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
11402 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); __PYX_ERR(0, 486, __pyx_L3_error)
11405 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
11407 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); __PYX_ERR(0, 486, __pyx_L3_error)
11410 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
11412 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); __PYX_ERR(0, 486, __pyx_L3_error)
11415 if (unlikely(kw_args > 0)) {
11416 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) __PYX_ERR(0, 486, __pyx_L3_error)
11418 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
11419 goto __pyx_L5_argtuple_error;
11421 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11422 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11423 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11424 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11425 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11426 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11427 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11428 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11429 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
11430 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11431 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11432 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11433 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11434 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11435 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11436 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11437 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11438 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11439 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11440 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11441 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11443 __pyx_v_gravity = ((PyArrayObject *)values[0]);
11444 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
11445 __pyx_v_colind = ((PyArrayObject *)values[2]);
11446 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error)
11447 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 491, __pyx_L3_error)
11448 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 492, __pyx_L3_error)
11449 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
11450 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
11451 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L3_error)
11452 __pyx_v_q_u = ((PyArrayObject *)values[9]);
11453 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
11454 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
11455 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
11456 __pyx_v_q_m = ((PyArrayObject *)values[13]);
11457 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
11458 __pyx_v_q_r = ((PyArrayObject *)values[15]);
11459 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
11460 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
11461 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
11462 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
11463 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
11465 goto __pyx_L4_argument_unpacking_done;
11466 __pyx_L5_argtuple_error:;
11467 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 486, __pyx_L3_error)
11469 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11470 __Pyx_RefNannyFinishContext();
11472 __pyx_L4_argument_unpacking_done:;
11473 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 486, __pyx_L1_error)
11474 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 487, __pyx_L1_error)
11475 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 488, __pyx_L1_error)
11476 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 493, __pyx_L1_error)
11477 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 494, __pyx_L1_error)
11478 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 497, __pyx_L1_error)
11479 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 498, __pyx_L1_error)
11480 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 499, __pyx_L1_error)
11481 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 501, __pyx_L1_error)
11482 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 502, __pyx_L1_error)
11483 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 503, __pyx_L1_error)
11484 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 504, __pyx_L1_error)
11485 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 505, __pyx_L1_error)
11486 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 506, __pyx_L1_error)
11487 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 509, __pyx_L1_error)
11488 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 510, __pyx_L1_error)
11489 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) __PYX_ERR(0, 512, __pyx_L1_error)
11490 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
11497 __Pyx_RefNannyFinishContext();
11501 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
11502 CYTHON_UNUSED
int __pyx_v_upwindFlag;
11503 PyObject *__pyx_v_q = NULL;
11510 PyArrayObject *__pyx_v_a_up = 0;
11511 PyArrayObject *__pyx_v_f_up = 0;
11512 double __pyx_v_nAvgWeight;
11513 double __pyx_v_weight;
11514 double __pyx_v_volFactor;
11515 double __pyx_v_volume;
11516 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
11517 __Pyx_Buffer __pyx_pybuffer_a_up;
11518 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
11519 __Pyx_Buffer __pyx_pybuffer_colind;
11520 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
11521 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
11522 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
11523 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
11524 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
11525 __Pyx_Buffer __pyx_pybuffer_elementResidual;
11526 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
11527 __Pyx_Buffer __pyx_pybuffer_f_up;
11528 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
11529 __Pyx_Buffer __pyx_pybuffer_gravity;
11530 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
11531 __Pyx_Buffer __pyx_pybuffer_q_alin;
11532 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
11533 __Pyx_Buffer __pyx_pybuffer_q_detJ;
11534 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
11535 __Pyx_Buffer __pyx_pybuffer_q_flin;
11536 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
11537 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
11538 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
11539 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
11540 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
11541 __Pyx_Buffer __pyx_pybuffer_q_kr;
11542 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
11543 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
11544 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
11545 __Pyx_Buffer __pyx_pybuffer_q_m;
11546 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
11547 __Pyx_Buffer __pyx_pybuffer_q_mt;
11548 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
11549 __Pyx_Buffer __pyx_pybuffer_q_r;
11550 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
11551 __Pyx_Buffer __pyx_pybuffer_q_u;
11552 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
11553 __Pyx_Buffer __pyx_pybuffer_rowptr;
11554 PyObject *__pyx_r = NULL;
11555 __Pyx_RefNannyDeclarations
11556 PyObject *__pyx_t_1 = NULL;
11557 PyObject *__pyx_t_2 = NULL;
11558 Py_ssize_t __pyx_t_3;
11559 PyObject *__pyx_t_4 = NULL;
11560 PyObject *__pyx_t_5 = NULL;
11562 Py_ssize_t __pyx_t_7;
11564 PyObject *__pyx_t_9 = NULL;
11565 PyArrayObject *__pyx_t_10 = NULL;
11566 PyArrayObject *__pyx_t_11 = NULL;
11569 Py_ssize_t __pyx_t_14;
11570 Py_ssize_t __pyx_t_15;
11573 Py_ssize_t __pyx_t_18;
11574 Py_ssize_t __pyx_t_19;
11576 Py_ssize_t __pyx_t_21;
11577 Py_ssize_t __pyx_t_22;
11578 Py_ssize_t __pyx_t_23;
11579 Py_ssize_t __pyx_t_24;
11580 Py_ssize_t __pyx_t_25;
11581 Py_ssize_t __pyx_t_26;
11585 Py_ssize_t __pyx_t_30;
11586 Py_ssize_t __pyx_t_31;
11587 Py_ssize_t __pyx_t_32;
11589 Py_ssize_t __pyx_t_34;
11590 Py_ssize_t __pyx_t_35;
11591 Py_ssize_t __pyx_t_36;
11592 Py_ssize_t __pyx_t_37;
11593 Py_ssize_t __pyx_t_38;
11594 Py_ssize_t __pyx_t_39;
11595 Py_ssize_t __pyx_t_40;
11596 Py_ssize_t __pyx_t_41;
11597 Py_ssize_t __pyx_t_42;
11598 Py_ssize_t __pyx_t_43;
11599 Py_ssize_t __pyx_t_44;
11600 Py_ssize_t __pyx_t_45;
11601 Py_ssize_t __pyx_t_46;
11602 Py_ssize_t __pyx_t_47;
11603 Py_ssize_t __pyx_t_48;
11604 Py_ssize_t __pyx_t_49;
11605 Py_ssize_t __pyx_t_50;
11606 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_51;
11607 Py_ssize_t __pyx_t_52;
11608 Py_ssize_t __pyx_t_53;
11610 Py_ssize_t __pyx_t_55;
11611 Py_ssize_t __pyx_t_56;
11612 Py_ssize_t __pyx_t_57;
11613 Py_ssize_t __pyx_t_58;
11614 Py_ssize_t __pyx_t_59;
11615 Py_ssize_t __pyx_t_60;
11616 Py_ssize_t __pyx_t_61;
11617 Py_ssize_t __pyx_t_62;
11618 Py_ssize_t __pyx_t_63;
11619 Py_ssize_t __pyx_t_64;
11620 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
11621 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
11622 __pyx_pybuffer_a_up.refcount = 0;
11623 __pyx_pybuffernd_a_up.data = NULL;
11624 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
11625 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
11626 __pyx_pybuffer_f_up.refcount = 0;
11627 __pyx_pybuffernd_f_up.data = NULL;
11628 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
11629 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
11630 __pyx_pybuffer_gravity.refcount = 0;
11631 __pyx_pybuffernd_gravity.data = NULL;
11632 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
11633 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
11634 __pyx_pybuffer_rowptr.refcount = 0;
11635 __pyx_pybuffernd_rowptr.data = NULL;
11636 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
11637 __pyx_pybuffer_colind.pybuffer.buf = NULL;
11638 __pyx_pybuffer_colind.refcount = 0;
11639 __pyx_pybuffernd_colind.data = NULL;
11640 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
11641 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
11642 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
11643 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
11644 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
11645 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
11646 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
11647 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
11648 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
11649 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
11650 __pyx_pybuffer_q_u.refcount = 0;
11651 __pyx_pybuffernd_q_u.data = NULL;
11652 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
11653 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
11654 __pyx_pybuffer_q_grad_u.refcount = 0;
11655 __pyx_pybuffernd_q_grad_u.data = NULL;
11656 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
11657 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
11658 __pyx_pybuffer_q_grad_w.refcount = 0;
11659 __pyx_pybuffernd_q_grad_w.data = NULL;
11660 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
11661 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
11662 __pyx_pybuffer_q_detJ.refcount = 0;
11663 __pyx_pybuffernd_q_detJ.data = NULL;
11664 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
11665 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
11666 __pyx_pybuffer_q_m.refcount = 0;
11667 __pyx_pybuffernd_q_m.data = NULL;
11668 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
11669 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
11670 __pyx_pybuffer_q_mt.refcount = 0;
11671 __pyx_pybuffernd_q_mt.data = NULL;
11672 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
11673 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
11674 __pyx_pybuffer_q_r.refcount = 0;
11675 __pyx_pybuffernd_q_r.data = NULL;
11676 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
11677 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
11678 __pyx_pybuffer_q_kr.refcount = 0;
11679 __pyx_pybuffernd_q_kr.data = NULL;
11680 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
11681 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
11682 __pyx_pybuffer_q_kr_up.refcount = 0;
11683 __pyx_pybuffernd_q_kr_up.data = NULL;
11684 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
11685 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
11686 __pyx_pybuffer_q_flin.refcount = 0;
11687 __pyx_pybuffernd_q_flin.data = NULL;
11688 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
11689 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
11690 __pyx_pybuffer_q_alin.refcount = 0;
11691 __pyx_pybuffernd_q_alin.data = NULL;
11692 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
11693 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
11694 __pyx_pybuffer_elementResidual.refcount = 0;
11695 __pyx_pybuffernd_elementResidual.data = NULL;
11696 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
11698 __Pyx_BufFmt_StackElem __pyx_stack[1];
11699 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11701 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
11703 __Pyx_BufFmt_StackElem __pyx_stack[1];
11704 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11706 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
11708 __Pyx_BufFmt_StackElem __pyx_stack[1];
11709 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11711 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
11713 __Pyx_BufFmt_StackElem __pyx_stack[1];
11714 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11716 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
11718 __Pyx_BufFmt_StackElem __pyx_stack[1];
11719 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11721 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
11723 __Pyx_BufFmt_StackElem __pyx_stack[1];
11724 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11726 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
11728 __Pyx_BufFmt_StackElem __pyx_stack[1];
11729 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11731 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
11733 __Pyx_BufFmt_StackElem __pyx_stack[1];
11734 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11736 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
11738 __Pyx_BufFmt_StackElem __pyx_stack[1];
11739 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11741 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
11743 __Pyx_BufFmt_StackElem __pyx_stack[1];
11744 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11746 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
11748 __Pyx_BufFmt_StackElem __pyx_stack[1];
11749 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11751 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
11753 __Pyx_BufFmt_StackElem __pyx_stack[1];
11754 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11756 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
11758 __Pyx_BufFmt_StackElem __pyx_stack[1];
11759 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11761 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
11763 __Pyx_BufFmt_StackElem __pyx_stack[1];
11764 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11766 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
11768 __Pyx_BufFmt_StackElem __pyx_stack[1];
11769 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11771 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
11773 __Pyx_BufFmt_StackElem __pyx_stack[1];
11774 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11776 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
11778 __Pyx_BufFmt_StackElem __pyx_stack[1];
11779 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
11781 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
11790 __pyx_v_upwindFlag = 1;
11799 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
11800 __Pyx_GOTREF(__pyx_t_1);
11801 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
11802 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
11803 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
11804 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
11805 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
11806 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
11807 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
11808 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
11809 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
11810 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
11811 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
11812 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
11813 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
11814 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
11815 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
11816 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11819 if (__pyx_t_3 >= 5)
break;
11820 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 11821 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error)
11823 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
11824 __Pyx_GOTREF(__pyx_t_1);
11826 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
11836 #ifndef CYTHON_WITHOUT_ASSERTIONS 11837 if (unlikely(!Py_OptimizeFlag)) {
11838 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
11839 __Pyx_GOTREF(__pyx_t_1);
11840 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
11841 __Pyx_GOTREF(__pyx_t_4);
11842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11843 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
11844 __Pyx_GOTREF(__pyx_t_1);
11845 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 530, __pyx_L1_error)
11846 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11847 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11848 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 530, __pyx_L1_error)
11849 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11850 if (unlikely(!__pyx_t_6)) {
11851 PyErr_SetNone(PyExc_AssertionError);
11852 __PYX_ERR(0, 530, __pyx_L1_error)
11865 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11874 #ifndef CYTHON_WITHOUT_ASSERTIONS 11875 if (unlikely(!Py_OptimizeFlag)) {
11876 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
11877 PyErr_SetNone(PyExc_AssertionError);
11878 __PYX_ERR(0, 531, __pyx_L1_error)
11890 __pyx_t_7 = __pyx_v_nSpace;
11892 if (__pyx_t_7 < 0) {
11893 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
11894 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
11895 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
11896 if (unlikely(__pyx_t_8 != -1)) {
11897 __Pyx_RaiseBufferIndexError(__pyx_t_8);
11898 __PYX_ERR(0, 532, __pyx_L1_error)
11900 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
11909 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
11910 __Pyx_GOTREF(__pyx_t_5);
11911 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
11912 __Pyx_GOTREF(__pyx_t_1);
11913 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11914 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
11915 __Pyx_GOTREF(__pyx_t_5);
11918 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11919 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11920 if (likely(__pyx_t_4)) {
11921 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11922 __Pyx_INCREF(__pyx_t_4);
11923 __Pyx_INCREF(
function);
11924 __Pyx_DECREF_SET(__pyx_t_1,
function);
11928 #if CYTHON_FAST_PYCALL 11929 if (PyFunction_Check(__pyx_t_1)) {
11930 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
11931 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
11932 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11933 __Pyx_GOTREF(__pyx_t_2);
11934 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11937 #if CYTHON_FAST_PYCCALL 11938 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11939 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
11940 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
11941 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11942 __Pyx_GOTREF(__pyx_t_2);
11943 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11947 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 536, __pyx_L1_error)
11948 __Pyx_GOTREF(__pyx_t_9);
11950 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
11952 __Pyx_GIVEREF(__pyx_t_5);
11953 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
11954 __Pyx_INCREF(__pyx_n_s_d);
11955 __Pyx_GIVEREF(__pyx_n_s_d);
11956 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
11958 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
11959 __Pyx_GOTREF(__pyx_t_2);
11960 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11963 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 536, __pyx_L1_error)
11964 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
11966 __Pyx_BufFmt_StackElem __pyx_stack[1];
11967 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11968 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
11969 __PYX_ERR(0, 536, __pyx_L1_error)
11970 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
11974 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
11984 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
11985 __Pyx_GOTREF(__pyx_t_1);
11986 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error)
11987 __Pyx_GOTREF(__pyx_t_9);
11988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11989 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
11990 __Pyx_GOTREF(__pyx_t_1);
11993 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
11994 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
11995 if (likely(__pyx_t_5)) {
11996 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
11997 __Pyx_INCREF(__pyx_t_5);
11998 __Pyx_INCREF(
function);
11999 __Pyx_DECREF_SET(__pyx_t_9,
function);
12003 #if CYTHON_FAST_PYCALL 12004 if (PyFunction_Check(__pyx_t_9)) {
12005 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12006 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12007 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12008 __Pyx_GOTREF(__pyx_t_2);
12009 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12012 #if CYTHON_FAST_PYCCALL 12013 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
12014 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
12015 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12016 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12017 __Pyx_GOTREF(__pyx_t_2);
12018 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12022 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
12023 __Pyx_GOTREF(__pyx_t_4);
12025 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12027 __Pyx_GIVEREF(__pyx_t_1);
12028 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
12029 __Pyx_INCREF(__pyx_n_s_d);
12030 __Pyx_GIVEREF(__pyx_n_s_d);
12031 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
12033 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
12034 __Pyx_GOTREF(__pyx_t_2);
12035 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12037 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12038 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 537, __pyx_L1_error)
12039 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12041 __Pyx_BufFmt_StackElem __pyx_stack[1];
12042 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12043 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12044 __PYX_ERR(0, 537, __pyx_L1_error)
12045 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12049 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12059 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12060 if (unlikely(__pyx_t_12 == 0)) {
12061 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12062 __PYX_ERR(0, 539, __pyx_L1_error)
12064 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12073 __pyx_v_weight = 1.0;
12074 __pyx_v_volFactor = 1.0;
12083 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12093 __pyx_v_volFactor = 0.5;
12111 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12121 __pyx_v_volFactor = (1.0 / 6.0);
12139 __pyx_t_8 = __pyx_v_nElements_global;
12140 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
12141 __pyx_v_eN = __pyx_t_13;
12150 __pyx_t_14 = __pyx_v_eN;
12153 if (__pyx_t_14 < 0) {
12154 __pyx_t_14 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12155 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
12156 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
12157 if (__pyx_t_15 < 0) {
12158 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12159 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
12160 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
12161 if (unlikely(__pyx_t_16 != -1)) {
12162 __Pyx_RaiseBufferIndexError(__pyx_t_16);
12163 __PYX_ERR(0, 547, __pyx_L1_error)
12165 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12174 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12183 __pyx_t_16 = __pyx_v_nDOF_test_element;
12184 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
12185 __pyx_v_i = __pyx_t_17;
12194 __pyx_t_18 = __pyx_v_eN;
12195 __pyx_t_19 = __pyx_v_i;
12197 if (__pyx_t_18 < 0) {
12198 __pyx_t_18 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
12199 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
12200 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_20 = 0;
12201 if (__pyx_t_19 < 0) {
12202 __pyx_t_19 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
12203 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
12204 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_20 = 1;
12205 if (unlikely(__pyx_t_20 != -1)) {
12206 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12207 __PYX_ERR(0, 553, __pyx_L1_error)
12209 __pyx_t_21 = __pyx_v_eN;
12210 __pyx_t_22 = __pyx_v_i;
12212 if (__pyx_t_21 < 0) {
12213 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12214 if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
12215 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_20 = 0;
12216 if (__pyx_t_22 < 0) {
12217 __pyx_t_22 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12218 if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 1;
12219 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_20 = 1;
12220 if (unlikely(__pyx_t_20 != -1)) {
12221 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12222 __PYX_ERR(0, 553, __pyx_L1_error)
12224 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
12233 __pyx_t_23 = __pyx_v_eN;
12234 __pyx_t_24 = __pyx_v_i;
12236 if (__pyx_t_23 < 0) {
12237 __pyx_t_23 += __pyx_pybuffernd_q_r.diminfo[0].shape;
12238 if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 0;
12239 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_20 = 0;
12240 if (__pyx_t_24 < 0) {
12241 __pyx_t_24 += __pyx_pybuffernd_q_r.diminfo[1].shape;
12242 if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 1;
12243 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_20 = 1;
12244 if (unlikely(__pyx_t_20 != -1)) {
12245 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12246 __PYX_ERR(0, 555, __pyx_L1_error)
12248 __pyx_t_25 = __pyx_v_eN;
12249 __pyx_t_26 = __pyx_v_i;
12251 if (__pyx_t_25 < 0) {
12252 __pyx_t_25 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12253 if (unlikely(__pyx_t_25 < 0)) __pyx_t_20 = 0;
12254 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_20 = 0;
12255 if (__pyx_t_26 < 0) {
12256 __pyx_t_26 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12257 if (unlikely(__pyx_t_26 < 0)) __pyx_t_20 = 1;
12258 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_20 = 1;
12259 if (unlikely(__pyx_t_20 != -1)) {
12260 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12261 __PYX_ERR(0, 555, __pyx_L1_error)
12263 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_q_r.diminfo[1].strides)));
12272 __pyx_t_20 = __pyx_v_nElementBoundaries_element;
12273 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_20; __pyx_t_27+=1) {
12274 __pyx_v_ebN = __pyx_t_27;
12283 __pyx_t_28 = __pyx_v_nnz;
12284 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
12285 __pyx_v_ii = __pyx_t_29;
12294 __pyx_t_30 = __pyx_v_eN;
12295 __pyx_t_31 = __pyx_v_ebN;
12296 __pyx_t_32 = __pyx_v_ii;
12298 if (__pyx_t_30 < 0) {
12299 __pyx_t_30 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
12300 if (unlikely(__pyx_t_30 < 0)) __pyx_t_33 = 0;
12301 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_33 = 0;
12302 if (__pyx_t_31 < 0) {
12303 __pyx_t_31 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
12304 if (unlikely(__pyx_t_31 < 0)) __pyx_t_33 = 1;
12305 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_33 = 1;
12306 if (__pyx_t_32 < 0) {
12307 __pyx_t_32 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
12308 if (unlikely(__pyx_t_32 < 0)) __pyx_t_33 = 2;
12309 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_33 = 2;
12310 if (unlikely(__pyx_t_33 != -1)) {
12311 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12312 __PYX_ERR(0, 561, __pyx_L1_error)
12314 __pyx_t_34 = __pyx_v_eN;
12315 __pyx_t_35 = __pyx_v_ebN;
12317 if (__pyx_t_34 < 0) {
12318 __pyx_t_34 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12319 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 0;
12320 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_33 = 0;
12321 if (__pyx_t_35 < 0) {
12322 __pyx_t_35 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12323 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 1;
12324 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_33 = 1;
12325 if (unlikely(__pyx_t_33 != -1)) {
12326 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12327 __PYX_ERR(0, 561, __pyx_L1_error)
12329 __pyx_t_36 = __pyx_v_ii;
12331 if (__pyx_t_36 < 0) {
12332 __pyx_t_36 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12333 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 0;
12334 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
12335 if (unlikely(__pyx_t_33 != -1)) {
12336 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12337 __PYX_ERR(0, 561, __pyx_L1_error)
12339 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12349 __pyx_t_28 = __pyx_v_nSpace;
12350 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
12351 __pyx_v_I = __pyx_t_29;
12360 __pyx_t_37 = __pyx_v_eN;
12361 __pyx_t_38 = __pyx_v_ebN;
12362 __pyx_t_39 = __pyx_v_I;
12364 if (__pyx_t_37 < 0) {
12365 __pyx_t_37 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
12366 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 0;
12367 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_33 = 0;
12368 if (__pyx_t_38 < 0) {
12369 __pyx_t_38 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
12370 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 1;
12371 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_33 = 1;
12372 if (__pyx_t_39 < 0) {
12373 __pyx_t_39 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
12374 if (unlikely(__pyx_t_39 < 0)) __pyx_t_33 = 2;
12375 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_33 = 2;
12376 if (unlikely(__pyx_t_33 != -1)) {
12377 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12378 __PYX_ERR(0, 563, __pyx_L1_error)
12380 __pyx_t_40 = __pyx_v_eN;
12381 __pyx_t_41 = __pyx_v_ebN;
12383 if (__pyx_t_40 < 0) {
12384 __pyx_t_40 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
12385 if (unlikely(__pyx_t_40 < 0)) __pyx_t_33 = 0;
12386 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_33 = 0;
12387 if (__pyx_t_41 < 0) {
12388 __pyx_t_41 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
12389 if (unlikely(__pyx_t_41 < 0)) __pyx_t_33 = 1;
12390 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_33 = 1;
12391 if (unlikely(__pyx_t_33 != -1)) {
12392 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12393 __PYX_ERR(0, 563, __pyx_L1_error)
12395 __pyx_t_42 = __pyx_v_I;
12397 if (__pyx_t_42 < 0) {
12398 __pyx_t_42 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12399 if (unlikely(__pyx_t_42 < 0)) __pyx_t_33 = 0;
12400 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_33 = 0;
12401 if (unlikely(__pyx_t_33 != -1)) {
12402 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12403 __PYX_ERR(0, 563, __pyx_L1_error)
12405 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
12415 __pyx_t_28 = __pyx_v_nSpace;
12416 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
12417 __pyx_v_I = __pyx_t_29;
12426 __pyx_t_43 = __pyx_v_I;
12428 if (__pyx_t_43 < 0) {
12429 __pyx_t_43 += __pyx_pybuffernd_f_up.diminfo[0].shape;
12430 if (unlikely(__pyx_t_43 < 0)) __pyx_t_33 = 0;
12431 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_33 = 0;
12432 if (unlikely(__pyx_t_33 != -1)) {
12433 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12434 __PYX_ERR(0, 567, __pyx_L1_error)
12436 __pyx_t_44 = __pyx_v_eN;
12437 __pyx_t_45 = __pyx_v_ebN;
12438 __pyx_t_46 = __pyx_v_i;
12439 __pyx_t_47 = __pyx_v_I;
12441 if (__pyx_t_44 < 0) {
12442 __pyx_t_44 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12443 if (unlikely(__pyx_t_44 < 0)) __pyx_t_33 = 0;
12444 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
12445 if (__pyx_t_45 < 0) {
12446 __pyx_t_45 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12447 if (unlikely(__pyx_t_45 < 0)) __pyx_t_33 = 1;
12448 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
12449 if (__pyx_t_46 < 0) {
12450 __pyx_t_46 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12451 if (unlikely(__pyx_t_46 < 0)) __pyx_t_33 = 2;
12452 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
12453 if (__pyx_t_47 < 0) {
12454 __pyx_t_47 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12455 if (unlikely(__pyx_t_47 < 0)) __pyx_t_33 = 3;
12456 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
12457 if (unlikely(__pyx_t_33 != -1)) {
12458 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12459 __PYX_ERR(0, 567, __pyx_L1_error)
12461 __pyx_t_48 = __pyx_v_eN;
12462 __pyx_t_49 = __pyx_v_i;
12464 if (__pyx_t_48 < 0) {
12465 __pyx_t_48 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12466 if (unlikely(__pyx_t_48 < 0)) __pyx_t_33 = 0;
12467 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_33 = 0;
12468 if (__pyx_t_49 < 0) {
12469 __pyx_t_49 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12470 if (unlikely(__pyx_t_49 < 0)) __pyx_t_33 = 1;
12471 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_33 = 1;
12472 if (unlikely(__pyx_t_33 != -1)) {
12473 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12474 __PYX_ERR(0, 567, __pyx_L1_error)
12476 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_47, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12485 __pyx_t_50 = (__pyx_v_I + 1);
12487 if (__pyx_t_50 < 0) {
12488 __pyx_t_50 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12489 if (unlikely(__pyx_t_50 < 0)) __pyx_t_33 = 0;
12490 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_33 = 0;
12491 if (unlikely(__pyx_t_33 != -1)) {
12492 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12493 __PYX_ERR(0, 568, __pyx_L1_error)
12495 __pyx_t_51 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12496 __pyx_t_52 = __pyx_v_I;
12498 if (__pyx_t_52 < 0) {
12499 __pyx_t_52 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12500 if (unlikely(__pyx_t_52 < 0)) __pyx_t_33 = 0;
12501 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_33 = 0;
12502 if (unlikely(__pyx_t_33 != -1)) {
12503 __Pyx_RaiseBufferIndexError(__pyx_t_33);
12504 __PYX_ERR(0, 568, __pyx_L1_error)
12506 for (__pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_33 < __pyx_t_51; __pyx_t_33+=1) {
12507 __pyx_v_ii = __pyx_t_33;
12516 __pyx_t_53 = __pyx_v_ii;
12518 if (__pyx_t_53 < 0) {
12519 __pyx_t_53 += __pyx_pybuffernd_a_up.diminfo[0].shape;
12520 if (unlikely(__pyx_t_53 < 0)) __pyx_t_54 = 0;
12521 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_54 = 0;
12522 if (unlikely(__pyx_t_54 != -1)) {
12523 __Pyx_RaiseBufferIndexError(__pyx_t_54);
12524 __PYX_ERR(0, 569, __pyx_L1_error)
12526 __pyx_t_55 = __pyx_v_ii;
12528 if (__pyx_t_55 < 0) {
12529 __pyx_t_55 += __pyx_pybuffernd_colind.diminfo[0].shape;
12530 if (unlikely(__pyx_t_55 < 0)) __pyx_t_54 = 0;
12531 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_54 = 0;
12532 if (unlikely(__pyx_t_54 != -1)) {
12533 __Pyx_RaiseBufferIndexError(__pyx_t_54);
12534 __PYX_ERR(0, 569, __pyx_L1_error)
12536 __pyx_t_56 = __pyx_v_eN;
12537 __pyx_t_57 = __pyx_v_ebN;
12538 __pyx_t_58 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_colind.diminfo[0].strides));
12540 if (__pyx_t_56 < 0) {
12541 __pyx_t_56 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
12542 if (unlikely(__pyx_t_56 < 0)) __pyx_t_54 = 0;
12543 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_54 = 0;
12544 if (__pyx_t_57 < 0) {
12545 __pyx_t_57 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
12546 if (unlikely(__pyx_t_57 < 0)) __pyx_t_54 = 1;
12547 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_54 = 1;
12548 if (__pyx_t_58 < 0) {
12549 __pyx_t_58 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
12550 if (unlikely(__pyx_t_58 < 0)) __pyx_t_54 = 2;
12551 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_54 = 2;
12552 if (unlikely(__pyx_t_54 != -1)) {
12553 __Pyx_RaiseBufferIndexError(__pyx_t_54);
12554 __PYX_ERR(0, 569, __pyx_L1_error)
12556 __pyx_t_59 = __pyx_v_eN;
12557 __pyx_t_60 = __pyx_v_ebN;
12558 __pyx_t_61 = __pyx_v_i;
12559 __pyx_t_62 = __pyx_v_I;
12561 if (__pyx_t_59 < 0) {
12562 __pyx_t_59 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
12563 if (unlikely(__pyx_t_59 < 0)) __pyx_t_54 = 0;
12564 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_54 = 0;
12565 if (__pyx_t_60 < 0) {
12566 __pyx_t_60 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
12567 if (unlikely(__pyx_t_60 < 0)) __pyx_t_54 = 1;
12568 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_54 = 1;
12569 if (__pyx_t_61 < 0) {
12570 __pyx_t_61 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
12571 if (unlikely(__pyx_t_61 < 0)) __pyx_t_54 = 2;
12572 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_54 = 2;
12573 if (__pyx_t_62 < 0) {
12574 __pyx_t_62 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
12575 if (unlikely(__pyx_t_62 < 0)) __pyx_t_54 = 3;
12576 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_54 = 3;
12577 if (unlikely(__pyx_t_54 != -1)) {
12578 __Pyx_RaiseBufferIndexError(__pyx_t_54);
12579 __PYX_ERR(0, 569, __pyx_L1_error)
12581 __pyx_t_63 = __pyx_v_eN;
12582 __pyx_t_64 = __pyx_v_i;
12584 if (__pyx_t_63 < 0) {
12585 __pyx_t_63 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
12586 if (unlikely(__pyx_t_63 < 0)) __pyx_t_54 = 0;
12587 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_54 = 0;
12588 if (__pyx_t_64 < 0) {
12589 __pyx_t_64 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
12590 if (unlikely(__pyx_t_64 < 0)) __pyx_t_54 = 1;
12591 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_54 = 1;
12592 if (unlikely(__pyx_t_54 != -1)) {
12593 __Pyx_RaiseBufferIndexError(__pyx_t_54);
12594 __PYX_ERR(0, 569, __pyx_L1_error)
12596 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_61, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_62, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
12612 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12615 __Pyx_XDECREF(__pyx_t_1);
12616 __Pyx_XDECREF(__pyx_t_2);
12617 __Pyx_XDECREF(__pyx_t_4);
12618 __Pyx_XDECREF(__pyx_t_5);
12619 __Pyx_XDECREF(__pyx_t_9);
12620 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12621 __Pyx_PyThreadState_declare
12622 __Pyx_PyThreadState_assign
12623 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12624 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
12625 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
12626 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
12627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
12628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
12629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
12630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
12631 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
12632 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
12633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
12634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
12635 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
12636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
12637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
12638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
12639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
12640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
12641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
12642 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
12643 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12644 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
12648 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
12649 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
12650 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
12651 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
12652 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
12653 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
12654 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
12655 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
12656 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
12657 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
12658 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
12659 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
12660 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
12661 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
12662 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
12663 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
12664 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
12665 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
12666 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
12668 __Pyx_XDECREF(__pyx_v_q);
12669 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
12670 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
12671 __Pyx_XGIVEREF(__pyx_r);
12672 __Pyx_RefNannyFinishContext();
12685 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
12686 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
12687 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
12688 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12689 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
12690 PyArrayObject *__pyx_v_rowptr = 0;
12691 PyArrayObject *__pyx_v_colind = 0;
12692 int __pyx_v_nSpace;
12693 int __pyx_v_nElements_global;
12694 int __pyx_v_nElementBoundaries_element;
12695 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
12696 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
12697 int __pyx_v_nDOF_test_element;
12698 int __pyx_v_nDOF_trial_element;
12699 PyArrayObject *__pyx_v_q_u = 0;
12700 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
12701 PyArrayObject *__pyx_v_q_grad_w = 0;
12702 PyArrayObject *__pyx_v_q_grad_v = 0;
12703 PyArrayObject *__pyx_v_q_detJ = 0;
12704 PyArrayObject *__pyx_v_q_m = 0;
12705 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
12706 PyArrayObject *__pyx_v_q_mt = 0;
12707 PyArrayObject *__pyx_v_q_dmt = 0;
12708 PyArrayObject *__pyx_v_q_r = 0;
12709 PyArrayObject *__pyx_v_q_kr = 0;
12710 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
12711 PyArrayObject *__pyx_v_q_kr_up = 0;
12712 PyArrayObject *__pyx_v_q_flin = 0;
12713 PyArrayObject *__pyx_v_q_alin = 0;
12714 PyArrayObject *__pyx_v_elementJacobian = 0;
12715 PyObject *__pyx_r = 0;
12716 __Pyx_RefNannyDeclarations
12717 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
12719 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
12720 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
12721 if (unlikely(__pyx_kwds)) {
12722 Py_ssize_t kw_args;
12723 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12724 switch (pos_args) {
12725 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
12726 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
12727 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
12728 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
12729 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
12730 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
12731 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
12732 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
12733 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
12734 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
12735 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
12736 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
12737 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
12738 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
12739 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
12740 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
12741 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
12742 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
12743 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12744 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12745 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12746 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12747 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12748 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12749 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12750 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12752 default:
goto __pyx_L5_argtuple_error;
12754 kw_args = PyDict_Size(__pyx_kwds);
12755 switch (pos_args) {
12757 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
12758 else goto __pyx_L5_argtuple_error;
12760 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
12762 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); __PYX_ERR(0, 574, __pyx_L3_error)
12765 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
12767 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); __PYX_ERR(0, 574, __pyx_L3_error)
12770 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
12772 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); __PYX_ERR(0, 574, __pyx_L3_error)
12775 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
12777 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); __PYX_ERR(0, 574, __pyx_L3_error)
12780 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
12782 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); __PYX_ERR(0, 574, __pyx_L3_error)
12785 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
12787 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); __PYX_ERR(0, 574, __pyx_L3_error)
12790 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
12792 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); __PYX_ERR(0, 574, __pyx_L3_error)
12795 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
12797 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); __PYX_ERR(0, 574, __pyx_L3_error)
12800 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
12802 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); __PYX_ERR(0, 574, __pyx_L3_error)
12805 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
12807 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); __PYX_ERR(0, 574, __pyx_L3_error)
12810 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
12812 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); __PYX_ERR(0, 574, __pyx_L3_error)
12815 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
12817 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); __PYX_ERR(0, 574, __pyx_L3_error)
12820 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
12822 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); __PYX_ERR(0, 574, __pyx_L3_error)
12825 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
12827 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); __PYX_ERR(0, 574, __pyx_L3_error)
12830 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
12832 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); __PYX_ERR(0, 574, __pyx_L3_error)
12835 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
12837 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); __PYX_ERR(0, 574, __pyx_L3_error)
12840 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
12842 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); __PYX_ERR(0, 574, __pyx_L3_error)
12845 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
12847 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); __PYX_ERR(0, 574, __pyx_L3_error)
12850 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
12852 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); __PYX_ERR(0, 574, __pyx_L3_error)
12855 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
12857 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); __PYX_ERR(0, 574, __pyx_L3_error)
12860 if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
12862 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); __PYX_ERR(0, 574, __pyx_L3_error)
12865 if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
12867 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); __PYX_ERR(0, 574, __pyx_L3_error)
12870 if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
12872 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); __PYX_ERR(0, 574, __pyx_L3_error)
12875 if (likely((values[24] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
12877 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); __PYX_ERR(0, 574, __pyx_L3_error)
12880 if (likely((values[25] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
12882 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); __PYX_ERR(0, 574, __pyx_L3_error)
12885 if (unlikely(kw_args > 0)) {
12886 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
12888 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
12889 goto __pyx_L5_argtuple_error;
12891 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12892 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12893 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12894 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12895 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12896 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12897 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12898 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12899 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
12900 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
12901 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
12902 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
12903 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
12904 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
12905 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
12906 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
12907 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
12908 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
12909 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
12910 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
12911 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
12912 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
12913 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
12914 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
12915 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
12916 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
12918 __pyx_v_gravity = ((PyArrayObject *)values[0]);
12919 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
12920 __pyx_v_colind = ((PyArrayObject *)values[2]);
12921 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
12922 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
12923 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
12924 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
12925 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
12926 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L3_error)
12927 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L3_error)
12928 __pyx_v_q_u = ((PyArrayObject *)values[10]);
12929 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
12930 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
12931 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
12932 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
12933 __pyx_v_q_m = ((PyArrayObject *)values[15]);
12934 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
12935 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
12936 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
12937 __pyx_v_q_r = ((PyArrayObject *)values[19]);
12938 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
12939 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
12940 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
12941 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
12942 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
12943 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
12945 goto __pyx_L4_argument_unpacking_done;
12946 __pyx_L5_argtuple_error:;
12947 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
12949 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
12950 __Pyx_RefNannyFinishContext();
12952 __pyx_L4_argument_unpacking_done:;
12953 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) __PYX_ERR(0, 574, __pyx_L1_error)
12954 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) __PYX_ERR(0, 575, __pyx_L1_error)
12955 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) __PYX_ERR(0, 576, __pyx_L1_error)
12956 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) __PYX_ERR(0, 581, __pyx_L1_error)
12957 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) __PYX_ERR(0, 582, __pyx_L1_error)
12958 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) __PYX_ERR(0, 586, __pyx_L1_error)
12959 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) __PYX_ERR(0, 587, __pyx_L1_error)
12960 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) __PYX_ERR(0, 588, __pyx_L1_error)
12961 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) __PYX_ERR(0, 589, __pyx_L1_error)
12962 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) __PYX_ERR(0, 591, __pyx_L1_error)
12963 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) __PYX_ERR(0, 592, __pyx_L1_error)
12964 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) __PYX_ERR(0, 593, __pyx_L1_error)
12965 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) __PYX_ERR(0, 594, __pyx_L1_error)
12966 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) __PYX_ERR(0, 595, __pyx_L1_error)
12967 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) __PYX_ERR(0, 596, __pyx_L1_error)
12968 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) __PYX_ERR(0, 597, __pyx_L1_error)
12969 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) __PYX_ERR(0, 598, __pyx_L1_error)
12970 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) __PYX_ERR(0, 599, __pyx_L1_error)
12971 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) __PYX_ERR(0, 602, __pyx_L1_error)
12972 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) __PYX_ERR(0, 603, __pyx_L1_error)
12973 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
12974 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
12981 __Pyx_RefNannyFinishContext();
12985 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
12986 CYTHON_UNUSED
int __pyx_v_upwindFlag;
12987 CYTHON_UNUSED
int __pyx_v_picard;
12988 PyObject *__pyx_v_q = NULL;
12993 PyArrayObject *__pyx_v_a_up = 0;
12994 PyArrayObject *__pyx_v_f_up = 0;
12995 double __pyx_v_nAvgWeight;
12996 double __pyx_v_weight;
12997 double __pyx_v_volFactor;
12998 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
12999 double __pyx_v_volume;
13003 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
13004 __Pyx_Buffer __pyx_pybuffer_a_up;
13005 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
13006 __Pyx_Buffer __pyx_pybuffer_colind;
13007 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
13008 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
13009 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
13010 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
13011 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
13012 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
13013 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
13014 __Pyx_Buffer __pyx_pybuffer_f_up;
13015 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
13016 __Pyx_Buffer __pyx_pybuffer_gravity;
13017 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
13018 __Pyx_Buffer __pyx_pybuffer_q_alin;
13019 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
13020 __Pyx_Buffer __pyx_pybuffer_q_detJ;
13021 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
13022 __Pyx_Buffer __pyx_pybuffer_q_dkr;
13023 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
13024 __Pyx_Buffer __pyx_pybuffer_q_dm;
13025 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
13026 __Pyx_Buffer __pyx_pybuffer_q_dmt;
13027 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
13028 __Pyx_Buffer __pyx_pybuffer_q_flin;
13029 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
13030 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
13031 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
13032 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
13033 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
13034 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
13035 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
13036 __Pyx_Buffer __pyx_pybuffer_q_kr;
13037 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
13038 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
13039 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
13040 __Pyx_Buffer __pyx_pybuffer_q_m;
13041 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
13042 __Pyx_Buffer __pyx_pybuffer_q_mt;
13043 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
13044 __Pyx_Buffer __pyx_pybuffer_q_r;
13045 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
13046 __Pyx_Buffer __pyx_pybuffer_q_u;
13047 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
13048 __Pyx_Buffer __pyx_pybuffer_rowptr;
13049 PyObject *__pyx_r = NULL;
13050 __Pyx_RefNannyDeclarations
13051 PyObject *__pyx_t_1 = NULL;
13052 PyObject *__pyx_t_2 = NULL;
13053 Py_ssize_t __pyx_t_3;
13054 PyObject *__pyx_t_4 = NULL;
13055 PyObject *__pyx_t_5 = NULL;
13057 Py_ssize_t __pyx_t_7;
13059 PyObject *__pyx_t_9 = NULL;
13060 PyArrayObject *__pyx_t_10 = NULL;
13061 PyArrayObject *__pyx_t_11 = NULL;
13064 Py_ssize_t __pyx_t_14;
13065 Py_ssize_t __pyx_t_15;
13068 Py_ssize_t __pyx_t_18;
13069 Py_ssize_t __pyx_t_19;
13071 Py_ssize_t __pyx_t_21;
13072 Py_ssize_t __pyx_t_22;
13073 Py_ssize_t __pyx_t_23;
13077 Py_ssize_t __pyx_t_27;
13078 Py_ssize_t __pyx_t_28;
13079 Py_ssize_t __pyx_t_29;
13081 Py_ssize_t __pyx_t_31;
13082 Py_ssize_t __pyx_t_32;
13083 Py_ssize_t __pyx_t_33;
13084 Py_ssize_t __pyx_t_34;
13085 Py_ssize_t __pyx_t_35;
13086 Py_ssize_t __pyx_t_36;
13087 Py_ssize_t __pyx_t_37;
13088 Py_ssize_t __pyx_t_38;
13089 Py_ssize_t __pyx_t_39;
13091 Py_ssize_t __pyx_t_41;
13093 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_43;
13094 Py_ssize_t __pyx_t_44;
13095 Py_ssize_t __pyx_t_45;
13097 Py_ssize_t __pyx_t_47;
13098 Py_ssize_t __pyx_t_48;
13099 Py_ssize_t __pyx_t_49;
13100 Py_ssize_t __pyx_t_50;
13101 Py_ssize_t __pyx_t_51;
13102 Py_ssize_t __pyx_t_52;
13103 Py_ssize_t __pyx_t_53;
13104 Py_ssize_t __pyx_t_54;
13105 Py_ssize_t __pyx_t_55;
13106 Py_ssize_t __pyx_t_56;
13107 Py_ssize_t __pyx_t_57;
13108 Py_ssize_t __pyx_t_58;
13109 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
13110 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
13111 __pyx_pybuffer_a_up.refcount = 0;
13112 __pyx_pybuffernd_a_up.data = NULL;
13113 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
13114 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
13115 __pyx_pybuffer_f_up.refcount = 0;
13116 __pyx_pybuffernd_f_up.data = NULL;
13117 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
13118 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
13119 __pyx_pybuffer_gravity.refcount = 0;
13120 __pyx_pybuffernd_gravity.data = NULL;
13121 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
13122 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
13123 __pyx_pybuffer_rowptr.refcount = 0;
13124 __pyx_pybuffernd_rowptr.data = NULL;
13125 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
13126 __pyx_pybuffer_colind.pybuffer.buf = NULL;
13127 __pyx_pybuffer_colind.refcount = 0;
13128 __pyx_pybuffernd_colind.data = NULL;
13129 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
13130 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
13131 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
13132 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
13133 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
13134 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
13135 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
13136 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
13137 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
13138 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
13139 __pyx_pybuffer_q_u.refcount = 0;
13140 __pyx_pybuffernd_q_u.data = NULL;
13141 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
13142 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
13143 __pyx_pybuffer_q_grad_u.refcount = 0;
13144 __pyx_pybuffernd_q_grad_u.data = NULL;
13145 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
13146 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
13147 __pyx_pybuffer_q_grad_w.refcount = 0;
13148 __pyx_pybuffernd_q_grad_w.data = NULL;
13149 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
13150 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
13151 __pyx_pybuffer_q_grad_v.refcount = 0;
13152 __pyx_pybuffernd_q_grad_v.data = NULL;
13153 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
13154 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
13155 __pyx_pybuffer_q_detJ.refcount = 0;
13156 __pyx_pybuffernd_q_detJ.data = NULL;
13157 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
13158 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
13159 __pyx_pybuffer_q_m.refcount = 0;
13160 __pyx_pybuffernd_q_m.data = NULL;
13161 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
13162 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
13163 __pyx_pybuffer_q_dm.refcount = 0;
13164 __pyx_pybuffernd_q_dm.data = NULL;
13165 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
13166 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
13167 __pyx_pybuffer_q_mt.refcount = 0;
13168 __pyx_pybuffernd_q_mt.data = NULL;
13169 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
13170 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
13171 __pyx_pybuffer_q_dmt.refcount = 0;
13172 __pyx_pybuffernd_q_dmt.data = NULL;
13173 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
13174 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
13175 __pyx_pybuffer_q_r.refcount = 0;
13176 __pyx_pybuffernd_q_r.data = NULL;
13177 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
13178 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
13179 __pyx_pybuffer_q_kr.refcount = 0;
13180 __pyx_pybuffernd_q_kr.data = NULL;
13181 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
13182 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
13183 __pyx_pybuffer_q_dkr.refcount = 0;
13184 __pyx_pybuffernd_q_dkr.data = NULL;
13185 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
13186 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
13187 __pyx_pybuffer_q_kr_up.refcount = 0;
13188 __pyx_pybuffernd_q_kr_up.data = NULL;
13189 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
13190 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
13191 __pyx_pybuffer_q_flin.refcount = 0;
13192 __pyx_pybuffernd_q_flin.data = NULL;
13193 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
13194 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
13195 __pyx_pybuffer_q_alin.refcount = 0;
13196 __pyx_pybuffernd_q_alin.data = NULL;
13197 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
13198 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
13199 __pyx_pybuffer_elementJacobian.refcount = 0;
13200 __pyx_pybuffernd_elementJacobian.data = NULL;
13201 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
13203 __Pyx_BufFmt_StackElem __pyx_stack[1];
13204 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13206 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
13208 __Pyx_BufFmt_StackElem __pyx_stack[1];
13209 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13211 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
13213 __Pyx_BufFmt_StackElem __pyx_stack[1];
13214 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13216 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
13218 __Pyx_BufFmt_StackElem __pyx_stack[1];
13219 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13221 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
13223 __Pyx_BufFmt_StackElem __pyx_stack[1];
13224 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13226 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
13228 __Pyx_BufFmt_StackElem __pyx_stack[1];
13229 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13231 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
13233 __Pyx_BufFmt_StackElem __pyx_stack[1];
13234 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13236 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
13238 __Pyx_BufFmt_StackElem __pyx_stack[1];
13239 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13241 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
13243 __Pyx_BufFmt_StackElem __pyx_stack[1];
13244 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13246 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
13248 __Pyx_BufFmt_StackElem __pyx_stack[1];
13249 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13251 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
13253 __Pyx_BufFmt_StackElem __pyx_stack[1];
13254 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13256 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
13258 __Pyx_BufFmt_StackElem __pyx_stack[1];
13259 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13261 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
13263 __Pyx_BufFmt_StackElem __pyx_stack[1];
13264 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13266 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
13268 __Pyx_BufFmt_StackElem __pyx_stack[1];
13269 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13271 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
13273 __Pyx_BufFmt_StackElem __pyx_stack[1];
13274 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13276 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
13278 __Pyx_BufFmt_StackElem __pyx_stack[1];
13279 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13281 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
13283 __Pyx_BufFmt_StackElem __pyx_stack[1];
13284 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13286 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
13288 __Pyx_BufFmt_StackElem __pyx_stack[1];
13289 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13291 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
13293 __Pyx_BufFmt_StackElem __pyx_stack[1];
13294 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13296 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
13298 __Pyx_BufFmt_StackElem __pyx_stack[1];
13299 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13301 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
13303 __Pyx_BufFmt_StackElem __pyx_stack[1];
13304 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 574, __pyx_L1_error)
13306 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
13315 __pyx_v_upwindFlag = 1;
13324 __pyx_v_picard = 1;
13333 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13334 __Pyx_GOTREF(__pyx_t_1);
13335 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
13336 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
13337 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
13338 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
13339 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
13340 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
13341 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
13342 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
13343 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
13344 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
13345 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
13346 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
13347 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
13348 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
13349 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
13350 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13353 if (__pyx_t_3 >= 5)
break;
13354 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 13355 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(0, 623, __pyx_L1_error)
13357 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
13358 __Pyx_GOTREF(__pyx_t_1);
13360 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
13370 #ifndef CYTHON_WITHOUT_ASSERTIONS 13371 if (unlikely(!Py_OptimizeFlag)) {
13372 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13373 __Pyx_GOTREF(__pyx_t_1);
13374 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error)
13375 __Pyx_GOTREF(__pyx_t_4);
13376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13377 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13378 __Pyx_GOTREF(__pyx_t_1);
13379 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
13380 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13381 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13382 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
13383 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13384 if (unlikely(!__pyx_t_6)) {
13385 PyErr_SetNone(PyExc_AssertionError);
13386 __PYX_ERR(0, 624, __pyx_L1_error)
13399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13408 #ifndef CYTHON_WITHOUT_ASSERTIONS 13409 if (unlikely(!Py_OptimizeFlag)) {
13410 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
13411 PyErr_SetNone(PyExc_AssertionError);
13412 __PYX_ERR(0, 625, __pyx_L1_error)
13424 __pyx_t_7 = __pyx_v_nSpace;
13426 if (__pyx_t_7 < 0) {
13427 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13428 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
13429 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
13430 if (unlikely(__pyx_t_8 != -1)) {
13431 __Pyx_RaiseBufferIndexError(__pyx_t_8);
13432 __PYX_ERR(0, 626, __pyx_L1_error)
13434 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13443 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13444 __Pyx_GOTREF(__pyx_t_5);
13445 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
13446 __Pyx_GOTREF(__pyx_t_1);
13447 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13448 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
13449 __Pyx_GOTREF(__pyx_t_5);
13452 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
13453 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
13454 if (likely(__pyx_t_4)) {
13455 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
13456 __Pyx_INCREF(__pyx_t_4);
13457 __Pyx_INCREF(
function);
13458 __Pyx_DECREF_SET(__pyx_t_1,
function);
13462 #if CYTHON_FAST_PYCALL 13463 if (PyFunction_Check(__pyx_t_1)) {
13464 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13465 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13466 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13467 __Pyx_GOTREF(__pyx_t_2);
13468 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13471 #if CYTHON_FAST_PYCCALL 13472 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
13473 PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_n_s_d};
13474 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13475 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13476 __Pyx_GOTREF(__pyx_t_2);
13477 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13481 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 630, __pyx_L1_error)
13482 __Pyx_GOTREF(__pyx_t_9);
13484 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
13486 __Pyx_GIVEREF(__pyx_t_5);
13487 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
13488 __Pyx_INCREF(__pyx_n_s_d);
13489 __Pyx_GIVEREF(__pyx_n_s_d);
13490 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_n_s_d);
13492 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_t_2);
13494 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13496 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13497 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
13498 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
13500 __Pyx_BufFmt_StackElem __pyx_stack[1];
13501 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13502 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
13503 __PYX_ERR(0, 630, __pyx_L1_error)
13504 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
13508 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
13518 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
13519 __Pyx_GOTREF(__pyx_t_1);
13520 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 631, __pyx_L1_error)
13521 __Pyx_GOTREF(__pyx_t_9);
13522 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13523 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
13524 __Pyx_GOTREF(__pyx_t_1);
13527 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
13528 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
13529 if (likely(__pyx_t_5)) {
13530 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
13531 __Pyx_INCREF(__pyx_t_5);
13532 __Pyx_INCREF(
function);
13533 __Pyx_DECREF_SET(__pyx_t_9,
function);
13537 #if CYTHON_FAST_PYCALL 13538 if (PyFunction_Check(__pyx_t_9)) {
13539 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
13540 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
13541 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13542 __Pyx_GOTREF(__pyx_t_2);
13543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13546 #if CYTHON_FAST_PYCCALL 13547 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
13548 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_n_s_d};
13549 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
13550 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13551 __Pyx_GOTREF(__pyx_t_2);
13552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13556 __pyx_t_4 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
13557 __Pyx_GOTREF(__pyx_t_4);
13559 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
13561 __Pyx_GIVEREF(__pyx_t_1);
13562 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_t_1);
13563 __Pyx_INCREF(__pyx_n_s_d);
13564 __Pyx_GIVEREF(__pyx_n_s_d);
13565 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_n_s_d);
13567 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
13568 __Pyx_GOTREF(__pyx_t_2);
13569 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13571 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13572 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
13573 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
13575 __Pyx_BufFmt_StackElem __pyx_stack[1];
13576 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
13577 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
13578 __PYX_ERR(0, 631, __pyx_L1_error)
13579 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
13583 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
13593 __pyx_t_12 = (__pyx_v_nSpace + 1.);
13594 if (unlikely(__pyx_t_12 == 0)) {
13595 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
13596 __PYX_ERR(0, 633, __pyx_L1_error)
13598 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
13607 __pyx_v_weight = 1.0;
13608 __pyx_v_volFactor = 1.0;
13617 __pyx_v_thisElementIsUpwind = 1;
13626 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
13636 __pyx_v_volFactor = 0.5;
13654 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
13664 __pyx_v_volFactor = (1.0 / 6.0);
13682 __pyx_t_8 = __pyx_v_nElements_global;
13683 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
13684 __pyx_v_eN = __pyx_t_13;
13693 __pyx_t_14 = __pyx_v_eN;
13696 if (__pyx_t_14 < 0) {
13697 __pyx_t_14 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
13698 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
13699 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
13700 if (__pyx_t_15 < 0) {
13701 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
13702 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
13703 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
13704 if (unlikely(__pyx_t_16 != -1)) {
13705 __Pyx_RaiseBufferIndexError(__pyx_t_16);
13706 __PYX_ERR(0, 642, __pyx_L1_error)
13708 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
13717 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
13726 __pyx_t_16 = __pyx_v_nDOF_test_element;
13727 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
13728 __pyx_v_i = __pyx_t_17;
13737 __pyx_t_18 = __pyx_v_eN;
13738 __pyx_t_19 = __pyx_v_i;
13740 if (__pyx_t_18 < 0) {
13741 __pyx_t_18 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
13742 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
13743 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_20 = 0;
13744 if (__pyx_t_19 < 0) {
13745 __pyx_t_19 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
13746 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
13747 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_20 = 1;
13748 if (unlikely(__pyx_t_20 != -1)) {
13749 __Pyx_RaiseBufferIndexError(__pyx_t_20);
13750 __PYX_ERR(0, 650, __pyx_L1_error)
13752 __pyx_t_21 = __pyx_v_eN;
13753 __pyx_t_22 = __pyx_v_i;
13754 __pyx_t_23 = __pyx_v_i;
13756 if (__pyx_t_21 < 0) {
13757 __pyx_t_21 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
13758 if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
13759 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_20 = 0;
13760 if (__pyx_t_22 < 0) {
13761 __pyx_t_22 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
13762 if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 1;
13763 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_20 = 1;
13764 if (__pyx_t_23 < 0) {
13765 __pyx_t_23 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
13766 if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 2;
13767 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_20 = 2;
13768 if (unlikely(__pyx_t_20 != -1)) {
13769 __Pyx_RaiseBufferIndexError(__pyx_t_20);
13770 __PYX_ERR(0, 650, __pyx_L1_error)
13772 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
13781 __pyx_t_20 = __pyx_v_nElementBoundaries_element;
13782 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_20; __pyx_t_24+=1) {
13783 __pyx_v_ebN = __pyx_t_24;
13792 __pyx_t_25 = __pyx_v_nnz;
13793 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13794 __pyx_v_ii = __pyx_t_26;
13803 __pyx_t_27 = __pyx_v_eN;
13804 __pyx_t_28 = __pyx_v_ebN;
13805 __pyx_t_29 = __pyx_v_ii;
13807 if (__pyx_t_27 < 0) {
13808 __pyx_t_27 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
13809 if (unlikely(__pyx_t_27 < 0)) __pyx_t_30 = 0;
13810 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_30 = 0;
13811 if (__pyx_t_28 < 0) {
13812 __pyx_t_28 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
13813 if (unlikely(__pyx_t_28 < 0)) __pyx_t_30 = 1;
13814 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_30 = 1;
13815 if (__pyx_t_29 < 0) {
13816 __pyx_t_29 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
13817 if (unlikely(__pyx_t_29 < 0)) __pyx_t_30 = 2;
13818 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_30 = 2;
13819 if (unlikely(__pyx_t_30 != -1)) {
13820 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13821 __PYX_ERR(0, 656, __pyx_L1_error)
13823 __pyx_t_31 = __pyx_v_eN;
13824 __pyx_t_32 = __pyx_v_ebN;
13826 if (__pyx_t_31 < 0) {
13827 __pyx_t_31 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
13828 if (unlikely(__pyx_t_31 < 0)) __pyx_t_30 = 0;
13829 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_30 = 0;
13830 if (__pyx_t_32 < 0) {
13831 __pyx_t_32 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
13832 if (unlikely(__pyx_t_32 < 0)) __pyx_t_30 = 1;
13833 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_30 = 1;
13834 if (unlikely(__pyx_t_30 != -1)) {
13835 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13836 __PYX_ERR(0, 656, __pyx_L1_error)
13838 __pyx_t_33 = __pyx_v_ii;
13840 if (__pyx_t_33 < 0) {
13841 __pyx_t_33 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13842 if (unlikely(__pyx_t_33 < 0)) __pyx_t_30 = 0;
13843 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_30 = 0;
13844 if (unlikely(__pyx_t_30 != -1)) {
13845 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13846 __PYX_ERR(0, 656, __pyx_L1_error)
13848 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
13858 __pyx_t_25 = __pyx_v_nSpace;
13859 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13860 __pyx_v_I = __pyx_t_26;
13869 __pyx_t_34 = __pyx_v_eN;
13870 __pyx_t_35 = __pyx_v_ebN;
13871 __pyx_t_36 = __pyx_v_I;
13873 if (__pyx_t_34 < 0) {
13874 __pyx_t_34 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
13875 if (unlikely(__pyx_t_34 < 0)) __pyx_t_30 = 0;
13876 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_30 = 0;
13877 if (__pyx_t_35 < 0) {
13878 __pyx_t_35 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
13879 if (unlikely(__pyx_t_35 < 0)) __pyx_t_30 = 1;
13880 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_30 = 1;
13881 if (__pyx_t_36 < 0) {
13882 __pyx_t_36 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
13883 if (unlikely(__pyx_t_36 < 0)) __pyx_t_30 = 2;
13884 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_30 = 2;
13885 if (unlikely(__pyx_t_30 != -1)) {
13886 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13887 __PYX_ERR(0, 658, __pyx_L1_error)
13889 __pyx_t_37 = __pyx_v_eN;
13890 __pyx_t_38 = __pyx_v_ebN;
13892 if (__pyx_t_37 < 0) {
13893 __pyx_t_37 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
13894 if (unlikely(__pyx_t_37 < 0)) __pyx_t_30 = 0;
13895 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_30 = 0;
13896 if (__pyx_t_38 < 0) {
13897 __pyx_t_38 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
13898 if (unlikely(__pyx_t_38 < 0)) __pyx_t_30 = 1;
13899 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_30 = 1;
13900 if (unlikely(__pyx_t_30 != -1)) {
13901 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13902 __PYX_ERR(0, 658, __pyx_L1_error)
13904 __pyx_t_39 = __pyx_v_I;
13906 if (__pyx_t_39 < 0) {
13907 __pyx_t_39 += __pyx_pybuffernd_f_up.diminfo[0].shape;
13908 if (unlikely(__pyx_t_39 < 0)) __pyx_t_30 = 0;
13909 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_30 = 0;
13910 if (unlikely(__pyx_t_30 != -1)) {
13911 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13912 __PYX_ERR(0, 658, __pyx_L1_error)
13914 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
13924 __pyx_t_25 = __pyx_v_nDOF_trial_element;
13925 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13926 __pyx_v_j = __pyx_t_26;
13935 __pyx_t_30 = __pyx_v_nSpace;
13936 for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_30; __pyx_t_40+=1) {
13937 __pyx_v_I = __pyx_t_40;
13946 __pyx_t_41 = (__pyx_v_I + 1);
13948 if (__pyx_t_41 < 0) {
13949 __pyx_t_41 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13950 if (unlikely(__pyx_t_41 < 0)) __pyx_t_42 = 0;
13951 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_42 = 0;
13952 if (unlikely(__pyx_t_42 != -1)) {
13953 __Pyx_RaiseBufferIndexError(__pyx_t_42);
13954 __PYX_ERR(0, 664, __pyx_L1_error)
13956 __pyx_t_43 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13957 __pyx_t_44 = __pyx_v_I;
13959 if (__pyx_t_44 < 0) {
13960 __pyx_t_44 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13961 if (unlikely(__pyx_t_44 < 0)) __pyx_t_42 = 0;
13962 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_42 = 0;
13963 if (unlikely(__pyx_t_42 != -1)) {
13964 __Pyx_RaiseBufferIndexError(__pyx_t_42);
13965 __PYX_ERR(0, 664, __pyx_L1_error)
13967 for (__pyx_t_42 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_42 < __pyx_t_43; __pyx_t_42+=1) {
13968 __pyx_v_ii = __pyx_t_42;
13977 __pyx_t_45 = __pyx_v_ii;
13979 if (__pyx_t_45 < 0) {
13980 __pyx_t_45 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13981 if (unlikely(__pyx_t_45 < 0)) __pyx_t_46 = 0;
13982 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_46 = 0;
13983 if (unlikely(__pyx_t_46 != -1)) {
13984 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13985 __PYX_ERR(0, 665, __pyx_L1_error)
13987 __pyx_t_47 = __pyx_v_ii;
13989 if (__pyx_t_47 < 0) {
13990 __pyx_t_47 += __pyx_pybuffernd_colind.diminfo[0].shape;
13991 if (unlikely(__pyx_t_47 < 0)) __pyx_t_46 = 0;
13992 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_46 = 0;
13993 if (unlikely(__pyx_t_46 != -1)) {
13994 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13995 __PYX_ERR(0, 665, __pyx_L1_error)
13997 __pyx_t_48 = __pyx_v_eN;
13998 __pyx_t_49 = __pyx_v_ebN;
13999 __pyx_t_50 = __pyx_v_j;
14000 __pyx_t_51 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_colind.diminfo[0].strides));
14002 if (__pyx_t_48 < 0) {
14003 __pyx_t_48 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
14004 if (unlikely(__pyx_t_48 < 0)) __pyx_t_46 = 0;
14005 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_46 = 0;
14006 if (__pyx_t_49 < 0) {
14007 __pyx_t_49 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
14008 if (unlikely(__pyx_t_49 < 0)) __pyx_t_46 = 1;
14009 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_46 = 1;
14010 if (__pyx_t_50 < 0) {
14011 __pyx_t_50 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
14012 if (unlikely(__pyx_t_50 < 0)) __pyx_t_46 = 2;
14013 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_46 = 2;
14014 if (__pyx_t_51 < 0) {
14015 __pyx_t_51 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
14016 if (unlikely(__pyx_t_51 < 0)) __pyx_t_46 = 3;
14017 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_46 = 3;
14018 if (unlikely(__pyx_t_46 != -1)) {
14019 __Pyx_RaiseBufferIndexError(__pyx_t_46);
14020 __PYX_ERR(0, 665, __pyx_L1_error)
14022 __pyx_t_52 = __pyx_v_eN;
14023 __pyx_t_53 = __pyx_v_ebN;
14024 __pyx_t_54 = __pyx_v_i;
14025 __pyx_t_55 = __pyx_v_I;
14027 if (__pyx_t_52 < 0) {
14028 __pyx_t_52 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
14029 if (unlikely(__pyx_t_52 < 0)) __pyx_t_46 = 0;
14030 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_46 = 0;
14031 if (__pyx_t_53 < 0) {
14032 __pyx_t_53 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
14033 if (unlikely(__pyx_t_53 < 0)) __pyx_t_46 = 1;
14034 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_46 = 1;
14035 if (__pyx_t_54 < 0) {
14036 __pyx_t_54 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
14037 if (unlikely(__pyx_t_54 < 0)) __pyx_t_46 = 2;
14038 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_46 = 2;
14039 if (__pyx_t_55 < 0) {
14040 __pyx_t_55 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
14041 if (unlikely(__pyx_t_55 < 0)) __pyx_t_46 = 3;
14042 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_46 = 3;
14043 if (unlikely(__pyx_t_46 != -1)) {
14044 __Pyx_RaiseBufferIndexError(__pyx_t_46);
14045 __PYX_ERR(0, 665, __pyx_L1_error)
14047 __pyx_t_56 = __pyx_v_eN;
14048 __pyx_t_57 = __pyx_v_i;
14049 __pyx_t_58 = __pyx_v_j;
14051 if (__pyx_t_56 < 0) {
14052 __pyx_t_56 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
14053 if (unlikely(__pyx_t_56 < 0)) __pyx_t_46 = 0;
14054 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_46 = 0;
14055 if (__pyx_t_57 < 0) {
14056 __pyx_t_57 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
14057 if (unlikely(__pyx_t_57 < 0)) __pyx_t_46 = 1;
14058 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_46 = 1;
14059 if (__pyx_t_58 < 0) {
14060 __pyx_t_58 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
14061 if (unlikely(__pyx_t_58 < 0)) __pyx_t_46 = 2;
14062 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_46 = 2;
14063 if (unlikely(__pyx_t_46 != -1)) {
14064 __Pyx_RaiseBufferIndexError(__pyx_t_46);
14065 __PYX_ERR(0, 665, __pyx_L1_error)
14067 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_55, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
14084 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14087 __Pyx_XDECREF(__pyx_t_1);
14088 __Pyx_XDECREF(__pyx_t_2);
14089 __Pyx_XDECREF(__pyx_t_4);
14090 __Pyx_XDECREF(__pyx_t_5);
14091 __Pyx_XDECREF(__pyx_t_9);
14092 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14093 __Pyx_PyThreadState_declare
14094 __Pyx_PyThreadState_assign
14095 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14096 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14097 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14098 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14099 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14100 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14101 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14102 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14103 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14104 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14105 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14106 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14107 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14108 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14109 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14111 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14112 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14113 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14114 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14115 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14118 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14119 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14120 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
14124 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
14125 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
14126 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
14127 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
14128 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
14129 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
14130 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
14131 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
14132 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
14133 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
14134 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
14135 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
14136 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
14137 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
14138 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
14139 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
14140 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
14141 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
14142 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
14143 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
14144 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
14145 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
14146 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
14148 __Pyx_XDECREF(__pyx_v_q);
14149 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
14150 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
14151 __Pyx_XGIVEREF(__pyx_r);
14152 __Pyx_RefNannyFinishContext();
14165 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14166 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
14167 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
14168 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14169 PyArrayObject *__pyx_v_mt = 0;
14170 PyArrayObject *__pyx_v_w = 0;
14171 PyArrayObject *__pyx_v_dV = 0;
14172 PyArrayObject *__pyx_v_weak_residual = 0;
14173 PyObject *__pyx_r = 0;
14174 __Pyx_RefNannyDeclarations
14175 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
14177 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
14178 PyObject* values[4] = {0,0,0,0};
14179 if (unlikely(__pyx_kwds)) {
14180 Py_ssize_t kw_args;
14181 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14182 switch (pos_args) {
14183 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14184 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14185 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14186 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14188 default:
goto __pyx_L5_argtuple_error;
14190 kw_args = PyDict_Size(__pyx_kwds);
14191 switch (pos_args) {
14193 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
14194 else goto __pyx_L5_argtuple_error;
14196 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14198 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); __PYX_ERR(0, 673, __pyx_L3_error)
14201 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14203 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); __PYX_ERR(0, 673, __pyx_L3_error)
14206 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
14208 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); __PYX_ERR(0, 673, __pyx_L3_error)
14211 if (unlikely(kw_args > 0)) {
14212 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) __PYX_ERR(0, 673, __pyx_L3_error)
14214 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14215 goto __pyx_L5_argtuple_error;
14217 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14218 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14219 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14220 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14222 __pyx_v_mt = ((PyArrayObject *)values[0]);
14223 __pyx_v_w = ((PyArrayObject *)values[1]);
14224 __pyx_v_dV = ((PyArrayObject *)values[2]);
14225 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
14227 goto __pyx_L4_argument_unpacking_done;
14228 __pyx_L5_argtuple_error:;
14229 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 673, __pyx_L3_error)
14231 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14232 __Pyx_RefNannyFinishContext();
14234 __pyx_L4_argument_unpacking_done:;
14235 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) __PYX_ERR(0, 673, __pyx_L1_error)
14236 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 674, __pyx_L1_error)
14237 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 675, __pyx_L1_error)
14238 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) __PYX_ERR(0, 676, __pyx_L1_error)
14239 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
14246 __Pyx_RefNannyFinishContext();
14250 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
14254 PyObject *__pyx_v_mt_avg = 0;
14255 PyObject *__pyx_v_vol = 0;
14256 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14257 __Pyx_Buffer __pyx_pybuffer_dV;
14258 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
14259 __Pyx_Buffer __pyx_pybuffer_mt;
14260 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14261 __Pyx_Buffer __pyx_pybuffer_w;
14262 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
14263 __Pyx_Buffer __pyx_pybuffer_weak_residual;
14264 PyObject *__pyx_r = NULL;
14265 __Pyx_RefNannyDeclarations
14266 npy_intp __pyx_t_1;
14268 npy_intp __pyx_t_3;
14270 Py_ssize_t __pyx_t_5;
14271 Py_ssize_t __pyx_t_6;
14273 Py_ssize_t __pyx_t_8;
14274 Py_ssize_t __pyx_t_9;
14275 PyObject *__pyx_t_10 = NULL;
14276 PyObject *__pyx_t_11 = NULL;
14277 Py_ssize_t __pyx_t_12;
14278 Py_ssize_t __pyx_t_13;
14279 Py_ssize_t __pyx_t_14;
14280 Py_ssize_t __pyx_t_15;
14281 Py_ssize_t __pyx_t_16;
14282 Py_ssize_t __pyx_t_17;
14283 Py_ssize_t __pyx_t_18;
14284 PyObject *__pyx_t_19 = NULL;
14286 Py_ssize_t __pyx_t_21;
14287 Py_ssize_t __pyx_t_22;
14288 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
14289 __pyx_pybuffer_mt.pybuffer.buf = NULL;
14290 __pyx_pybuffer_mt.refcount = 0;
14291 __pyx_pybuffernd_mt.data = NULL;
14292 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
14293 __pyx_pybuffer_w.pybuffer.buf = NULL;
14294 __pyx_pybuffer_w.refcount = 0;
14295 __pyx_pybuffernd_w.data = NULL;
14296 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14297 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14298 __pyx_pybuffer_dV.refcount = 0;
14299 __pyx_pybuffernd_dV.data = NULL;
14300 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14301 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
14302 __pyx_pybuffer_weak_residual.refcount = 0;
14303 __pyx_pybuffernd_weak_residual.data = NULL;
14304 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
14306 __Pyx_BufFmt_StackElem __pyx_stack[1];
14307 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14309 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
14311 __Pyx_BufFmt_StackElem __pyx_stack[1];
14312 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14314 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14316 __Pyx_BufFmt_StackElem __pyx_stack[1];
14317 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14319 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14321 __Pyx_BufFmt_StackElem __pyx_stack[1];
14322 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 673, __pyx_L1_error)
14324 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
14333 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
14334 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
14335 __pyx_v_eN = __pyx_t_2;
14344 __Pyx_INCREF(__pyx_float_0_0);
14345 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
14354 __Pyx_INCREF(__pyx_float_0_0);
14355 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
14364 __pyx_t_3 = (__pyx_v_mt->dimensions[1]);
14365 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14366 __pyx_v_k = __pyx_t_4;
14375 __pyx_t_5 = __pyx_v_eN;
14376 __pyx_t_6 = __pyx_v_k;
14378 if (__pyx_t_5 < 0) {
14379 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
14380 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
14381 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14382 if (__pyx_t_6 < 0) {
14383 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
14384 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
14385 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14386 if (unlikely(__pyx_t_7 != -1)) {
14387 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14388 __PYX_ERR(0, 686, __pyx_L1_error)
14390 __pyx_t_8 = __pyx_v_eN;
14391 __pyx_t_9 = __pyx_v_k;
14393 if (__pyx_t_8 < 0) {
14394 __pyx_t_8 += __pyx_pybuffernd_mt.diminfo[0].shape;
14395 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
14396 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_7 = 0;
14397 if (__pyx_t_9 < 0) {
14398 __pyx_t_9 += __pyx_pybuffernd_mt.diminfo[1].shape;
14399 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
14400 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_7 = 1;
14401 if (unlikely(__pyx_t_7 != -1)) {
14402 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14403 __PYX_ERR(0, 686, __pyx_L1_error)
14405 __pyx_t_10 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 686, __pyx_L1_error)
14406 __Pyx_GOTREF(__pyx_t_10);
14407 __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 686, __pyx_L1_error)
14408 __Pyx_GOTREF(__pyx_t_11);
14409 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14410 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_11);
14420 __pyx_t_12 = __pyx_v_eN;
14421 __pyx_t_13 = __pyx_v_k;
14423 if (__pyx_t_12 < 0) {
14424 __pyx_t_12 += __pyx_pybuffernd_dV.diminfo[0].shape;
14425 if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
14426 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14427 if (__pyx_t_13 < 0) {
14428 __pyx_t_13 += __pyx_pybuffernd_dV.diminfo[1].shape;
14429 if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 1;
14430 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14431 if (unlikely(__pyx_t_7 != -1)) {
14432 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14433 __PYX_ERR(0, 687, __pyx_L1_error)
14435 __pyx_t_11 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 687, __pyx_L1_error)
14436 __Pyx_GOTREF(__pyx_t_11);
14437 __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_11);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 687, __pyx_L1_error)
14438 __Pyx_GOTREF(__pyx_t_10);
14439 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14440 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_10);
14451 __pyx_t_10 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 688, __pyx_L1_error)
14452 __Pyx_GOTREF(__pyx_t_10);
14453 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_10);
14463 __pyx_t_3 = (__pyx_v_weak_residual->dimensions[1]);
14464 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14465 __pyx_v_i = __pyx_t_4;
14474 __pyx_t_14 = __pyx_v_eN;
14475 __pyx_t_15 = __pyx_v_k;
14476 __pyx_t_16 = __pyx_v_i;
14478 if (__pyx_t_14 < 0) {
14479 __pyx_t_14 += __pyx_pybuffernd_w.diminfo[0].shape;
14480 if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
14481 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_7 = 0;
14482 if (__pyx_t_15 < 0) {
14483 __pyx_t_15 += __pyx_pybuffernd_w.diminfo[1].shape;
14484 if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 1;
14485 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_7 = 1;
14486 if (__pyx_t_16 < 0) {
14487 __pyx_t_16 += __pyx_pybuffernd_w.diminfo[2].shape;
14488 if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 2;
14489 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_7 = 2;
14490 if (unlikely(__pyx_t_7 != -1)) {
14491 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14492 __PYX_ERR(0, 691, __pyx_L1_error)
14494 __pyx_t_10 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 691, __pyx_L1_error)
14495 __Pyx_GOTREF(__pyx_t_10);
14496 __pyx_t_11 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_10);
if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 691, __pyx_L1_error)
14497 __Pyx_GOTREF(__pyx_t_11);
14498 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14499 __pyx_t_17 = __pyx_v_eN;
14500 __pyx_t_18 = __pyx_v_k;
14502 if (__pyx_t_17 < 0) {
14503 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
14504 if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
14505 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14506 if (__pyx_t_18 < 0) {
14507 __pyx_t_18 += __pyx_pybuffernd_dV.diminfo[1].shape;
14508 if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 1;
14509 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14510 if (unlikely(__pyx_t_7 != -1)) {
14511 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14512 __PYX_ERR(0, 691, __pyx_L1_error)
14514 __pyx_t_10 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 691, __pyx_L1_error)
14515 __Pyx_GOTREF(__pyx_t_10);
14516 __pyx_t_19 = PyNumber_Multiply(__pyx_t_11, __pyx_t_10);
if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 691, __pyx_L1_error)
14517 __Pyx_GOTREF(__pyx_t_19);
14518 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14519 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14520 __pyx_t_20 = __Pyx_PyObject_AsDouble(__pyx_t_19);
if (unlikely(__pyx_t_20 == ((
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 691, __pyx_L1_error)
14521 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
14522 __pyx_t_21 = __pyx_v_eN;
14523 __pyx_t_22 = __pyx_v_i;
14525 if (__pyx_t_21 < 0) {
14526 __pyx_t_21 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
14527 if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0;
14528 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_7 = 0;
14529 if (__pyx_t_22 < 0) {
14530 __pyx_t_22 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
14531 if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 1;
14532 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_7 = 1;
14533 if (unlikely(__pyx_t_7 != -1)) {
14534 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14535 __PYX_ERR(0, 691, __pyx_L1_error)
14537 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_20;
14550 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14553 __Pyx_XDECREF(__pyx_t_10);
14554 __Pyx_XDECREF(__pyx_t_11);
14555 __Pyx_XDECREF(__pyx_t_19);
14556 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14557 __Pyx_PyThreadState_declare
14558 __Pyx_PyThreadState_assign
14559 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14560 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
14561 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
14562 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
14563 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
14564 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14565 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14569 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
14570 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
14571 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
14572 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
14574 __Pyx_XDECREF(__pyx_v_mt_avg);
14575 __Pyx_XDECREF(__pyx_v_vol);
14576 __Pyx_XGIVEREF(__pyx_r);
14577 __Pyx_RefNannyFinishContext();
14590 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14591 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
14592 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
14593 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14594 PyArrayObject *__pyx_v_dmt = 0;
14595 PyArrayObject *__pyx_v_w = 0;
14596 PyArrayObject *__pyx_v_v = 0;
14597 PyArrayObject *__pyx_v_dV = 0;
14598 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
14599 PyObject *__pyx_r = 0;
14600 __Pyx_RefNannyDeclarations
14601 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
14603 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
14604 PyObject* values[5] = {0,0,0,0,0};
14605 if (unlikely(__pyx_kwds)) {
14606 Py_ssize_t kw_args;
14607 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14608 switch (pos_args) {
14609 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
14610 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14611 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14612 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14613 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14615 default:
goto __pyx_L5_argtuple_error;
14617 kw_args = PyDict_Size(__pyx_kwds);
14618 switch (pos_args) {
14620 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
14621 else goto __pyx_L5_argtuple_error;
14623 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
14625 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); __PYX_ERR(0, 692, __pyx_L3_error)
14628 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
14630 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); __PYX_ERR(0, 692, __pyx_L3_error)
14633 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14635 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); __PYX_ERR(0, 692, __pyx_L3_error)
14638 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
14640 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); __PYX_ERR(0, 692, __pyx_L3_error)
14643 if (unlikely(kw_args > 0)) {
14644 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) __PYX_ERR(0, 692, __pyx_L3_error)
14646 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
14647 goto __pyx_L5_argtuple_error;
14649 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14650 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14651 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14652 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14653 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
14655 __pyx_v_dmt = ((PyArrayObject *)values[0]);
14656 __pyx_v_w = ((PyArrayObject *)values[1]);
14657 __pyx_v_v = ((PyArrayObject *)values[2]);
14658 __pyx_v_dV = ((PyArrayObject *)values[3]);
14659 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
14661 goto __pyx_L4_argument_unpacking_done;
14662 __pyx_L5_argtuple_error:;
14663 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 692, __pyx_L3_error)
14665 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14666 __Pyx_RefNannyFinishContext();
14668 __pyx_L4_argument_unpacking_done:;
14669 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
14670 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) __PYX_ERR(0, 693, __pyx_L1_error)
14671 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 694, __pyx_L1_error)
14672 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 695, __pyx_L1_error)
14673 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) __PYX_ERR(0, 696, __pyx_L1_error)
14674 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
14681 __Pyx_RefNannyFinishContext();
14685 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
14690 double __pyx_v_dmtj_avg;
14691 double __pyx_v_vol;
14692 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14693 __Pyx_Buffer __pyx_pybuffer_dV;
14694 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
14695 __Pyx_Buffer __pyx_pybuffer_dmt;
14696 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
14697 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
14698 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
14699 __Pyx_Buffer __pyx_pybuffer_v;
14700 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
14701 __Pyx_Buffer __pyx_pybuffer_w;
14702 PyObject *__pyx_r = NULL;
14703 __Pyx_RefNannyDeclarations
14704 npy_intp __pyx_t_1;
14706 npy_intp __pyx_t_3;
14708 Py_ssize_t __pyx_t_5;
14709 Py_ssize_t __pyx_t_6;
14711 npy_intp __pyx_t_8;
14712 npy_intp __pyx_t_9;
14714 Py_ssize_t __pyx_t_11;
14715 Py_ssize_t __pyx_t_12;
14717 Py_ssize_t __pyx_t_14;
14718 Py_ssize_t __pyx_t_15;
14719 Py_ssize_t __pyx_t_16;
14720 Py_ssize_t __pyx_t_17;
14721 Py_ssize_t __pyx_t_18;
14722 Py_ssize_t __pyx_t_19;
14723 Py_ssize_t __pyx_t_20;
14724 Py_ssize_t __pyx_t_21;
14725 Py_ssize_t __pyx_t_22;
14726 Py_ssize_t __pyx_t_23;
14727 Py_ssize_t __pyx_t_24;
14728 Py_ssize_t __pyx_t_25;
14729 Py_ssize_t __pyx_t_26;
14730 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
14731 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
14732 __pyx_pybuffer_dmt.refcount = 0;
14733 __pyx_pybuffernd_dmt.data = NULL;
14734 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
14735 __pyx_pybuffer_w.pybuffer.buf = NULL;
14736 __pyx_pybuffer_w.refcount = 0;
14737 __pyx_pybuffernd_w.data = NULL;
14738 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
14739 __pyx_pybuffer_v.pybuffer.buf = NULL;
14740 __pyx_pybuffer_v.refcount = 0;
14741 __pyx_pybuffernd_v.data = NULL;
14742 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
14743 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14744 __pyx_pybuffer_dV.refcount = 0;
14745 __pyx_pybuffernd_dV.data = NULL;
14746 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14747 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
14748 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
14749 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
14750 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
14752 __Pyx_BufFmt_StackElem __pyx_stack[1];
14753 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
14755 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
14757 __Pyx_BufFmt_StackElem __pyx_stack[1];
14758 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
14760 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
14762 __Pyx_BufFmt_StackElem __pyx_stack[1];
14763 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
14765 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
14767 __Pyx_BufFmt_StackElem __pyx_stack[1];
14768 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
14770 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14772 __Pyx_BufFmt_StackElem __pyx_stack[1];
14773 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
14775 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
14784 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
14785 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
14786 __pyx_v_eN = __pyx_t_2;
14804 __pyx_t_3 = (__pyx_v_dmt->dimensions[1]);
14805 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14806 __pyx_v_k = __pyx_t_4;
14815 __pyx_t_5 = __pyx_v_eN;
14816 __pyx_t_6 = __pyx_v_k;
14818 if (__pyx_t_5 < 0) {
14819 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
14820 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
14821 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14822 if (__pyx_t_6 < 0) {
14823 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
14824 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
14825 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14826 if (unlikely(__pyx_t_7 != -1)) {
14827 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14828 __PYX_ERR(0, 705, __pyx_L1_error)
14830 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
14840 __pyx_t_3 = (__pyx_v_w->dimensions[2]);
14841 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14842 __pyx_v_i = __pyx_t_4;
14851 __pyx_t_8 = (__pyx_v_v->dimensions[2]);
14852 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
14853 __pyx_v_j = __pyx_t_7;
14862 __pyx_v_dmtj_avg = 0.0;
14871 __pyx_t_9 = (__pyx_v_dmt->dimensions[1]);
14872 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
14873 __pyx_v_k = __pyx_t_10;
14882 __pyx_t_11 = __pyx_v_eN;
14883 __pyx_t_12 = __pyx_v_k;
14885 if (__pyx_t_11 < 0) {
14886 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
14887 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
14888 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_13 = 0;
14889 if (__pyx_t_12 < 0) {
14890 __pyx_t_12 += __pyx_pybuffernd_dV.diminfo[1].shape;
14891 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
14892 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_13 = 1;
14893 if (unlikely(__pyx_t_13 != -1)) {
14894 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14895 __PYX_ERR(0, 710, __pyx_L1_error)
14897 __pyx_t_14 = __pyx_v_eN;
14898 __pyx_t_15 = __pyx_v_k;
14900 if (__pyx_t_14 < 0) {
14901 __pyx_t_14 += __pyx_pybuffernd_dmt.diminfo[0].shape;
14902 if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
14903 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_13 = 0;
14904 if (__pyx_t_15 < 0) {
14905 __pyx_t_15 += __pyx_pybuffernd_dmt.diminfo[1].shape;
14906 if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
14907 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_13 = 1;
14908 if (unlikely(__pyx_t_13 != -1)) {
14909 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14910 __PYX_ERR(0, 710, __pyx_L1_error)
14912 __pyx_t_16 = __pyx_v_eN;
14913 __pyx_t_17 = __pyx_v_k;
14914 __pyx_t_18 = __pyx_v_j;
14916 if (__pyx_t_16 < 0) {
14917 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
14918 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
14919 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_13 = 0;
14920 if (__pyx_t_17 < 0) {
14921 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
14922 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
14923 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_13 = 1;
14924 if (__pyx_t_18 < 0) {
14925 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
14926 if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 2;
14927 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_13 = 2;
14928 if (unlikely(__pyx_t_13 != -1)) {
14929 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14930 __PYX_ERR(0, 710, __pyx_L1_error)
14932 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides))));
14942 if (unlikely(__pyx_v_vol == 0)) {
14943 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14944 __PYX_ERR(0, 711, __pyx_L1_error)
14946 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
14955 __pyx_t_19 = __pyx_v_eN;
14956 __pyx_t_20 = __pyx_v_k;
14957 __pyx_t_21 = __pyx_v_i;
14959 if (__pyx_t_19 < 0) {
14960 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[0].shape;
14961 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
14962 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_10 = 0;
14963 if (__pyx_t_20 < 0) {
14964 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[1].shape;
14965 if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 1;
14966 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_10 = 1;
14967 if (__pyx_t_21 < 0) {
14968 __pyx_t_21 += __pyx_pybuffernd_w.diminfo[2].shape;
14969 if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 2;
14970 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_10 = 2;
14971 if (unlikely(__pyx_t_10 != -1)) {
14972 __Pyx_RaiseBufferIndexError(__pyx_t_10);
14973 __PYX_ERR(0, 712, __pyx_L1_error)
14975 __pyx_t_22 = __pyx_v_eN;
14976 __pyx_t_23 = __pyx_v_k;
14978 if (__pyx_t_22 < 0) {
14979 __pyx_t_22 += __pyx_pybuffernd_dV.diminfo[0].shape;
14980 if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0;
14981 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_10 = 0;
14982 if (__pyx_t_23 < 0) {
14983 __pyx_t_23 += __pyx_pybuffernd_dV.diminfo[1].shape;
14984 if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 1;
14985 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_10 = 1;
14986 if (unlikely(__pyx_t_10 != -1)) {
14987 __Pyx_RaiseBufferIndexError(__pyx_t_10);
14988 __PYX_ERR(0, 712, __pyx_L1_error)
14990 __pyx_t_24 = __pyx_v_eN;
14991 __pyx_t_25 = __pyx_v_i;
14992 __pyx_t_26 = __pyx_v_j;
14994 if (__pyx_t_24 < 0) {
14995 __pyx_t_24 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
14996 if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0;
14997 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_10 = 0;
14998 if (__pyx_t_25 < 0) {
14999 __pyx_t_25 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
15000 if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1;
15001 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_10 = 1;
15002 if (__pyx_t_26 < 0) {
15003 __pyx_t_26 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
15004 if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2;
15005 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_10 = 2;
15006 if (unlikely(__pyx_t_10 != -1)) {
15007 __Pyx_RaiseBufferIndexError(__pyx_t_10);
15008 __PYX_ERR(0, 712, __pyx_L1_error)
15010 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dV.diminfo[1].strides)));
15024 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15027 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15028 __Pyx_PyThreadState_declare
15029 __Pyx_PyThreadState_assign
15030 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15031 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15032 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15033 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15034 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15035 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15036 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15037 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
15041 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15042 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
15043 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
15044 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15045 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
15047 __Pyx_XGIVEREF(__pyx_r);
15048 __Pyx_RefNannyFinishContext();
15061 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15062 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
15063 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15064 PyArrayObject *__pyx_v_v = 0;
15065 PyArrayObject *__pyx_v_n = 0;
15066 PyArrayObject *__pyx_v_dS = 0;
15067 PyArrayObject *__pyx_v_flux = 0;
15068 PyObject *__pyx_r = 0;
15069 __Pyx_RefNannyDeclarations
15070 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
15072 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
15073 PyObject* values[4] = {0,0,0,0};
15074 if (unlikely(__pyx_kwds)) {
15075 Py_ssize_t kw_args;
15076 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15077 switch (pos_args) {
15078 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15079 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15080 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15081 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15083 default:
goto __pyx_L5_argtuple_error;
15085 kw_args = PyDict_Size(__pyx_kwds);
15086 switch (pos_args) {
15088 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15089 else goto __pyx_L5_argtuple_error;
15091 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
15093 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); __PYX_ERR(0, 717, __pyx_L3_error)
15096 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
15098 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); __PYX_ERR(0, 717, __pyx_L3_error)
15101 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
15103 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); __PYX_ERR(0, 717, __pyx_L3_error)
15106 if (unlikely(kw_args > 0)) {
15107 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) __PYX_ERR(0, 717, __pyx_L3_error)
15109 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15110 goto __pyx_L5_argtuple_error;
15112 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15113 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15114 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15115 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15117 __pyx_v_v = ((PyArrayObject *)values[0]);
15118 __pyx_v_n = ((PyArrayObject *)values[1]);
15119 __pyx_v_dS = ((PyArrayObject *)values[2]);
15120 __pyx_v_flux = ((PyArrayObject *)values[3]);
15122 goto __pyx_L4_argument_unpacking_done;
15123 __pyx_L5_argtuple_error:;
15124 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 717, __pyx_L3_error)
15126 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15127 __Pyx_RefNannyFinishContext();
15129 __pyx_L4_argument_unpacking_done:;
15130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 717, __pyx_L1_error)
15131 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) __PYX_ERR(0, 718, __pyx_L1_error)
15132 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) __PYX_ERR(0, 719, __pyx_L1_error)
15133 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) __PYX_ERR(0, 720, __pyx_L1_error)
15134 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
15141 __Pyx_RefNannyFinishContext();
15145 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
15149 double __pyx_v_integral;
15150 npy_intp __pyx_v_I;
15151 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
15152 __Pyx_Buffer __pyx_pybuffer_dS;
15153 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
15154 __Pyx_Buffer __pyx_pybuffer_flux;
15155 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
15156 __Pyx_Buffer __pyx_pybuffer_n;
15157 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15158 __Pyx_Buffer __pyx_pybuffer_v;
15159 PyObject *__pyx_r = NULL;
15160 __Pyx_RefNannyDeclarations
15161 npy_intp __pyx_t_1;
15163 npy_intp __pyx_t_3;
15165 npy_intp __pyx_t_5;
15167 npy_intp __pyx_t_7;
15168 npy_intp __pyx_t_8;
15169 Py_ssize_t __pyx_t_9;
15170 Py_ssize_t __pyx_t_10;
15171 Py_ssize_t __pyx_t_11;
15172 Py_ssize_t __pyx_t_12;
15174 Py_ssize_t __pyx_t_14;
15175 Py_ssize_t __pyx_t_15;
15176 Py_ssize_t __pyx_t_16;
15177 Py_ssize_t __pyx_t_17;
15178 Py_ssize_t __pyx_t_18;
15179 Py_ssize_t __pyx_t_19;
15180 Py_ssize_t __pyx_t_20;
15181 Py_ssize_t __pyx_t_21;
15182 Py_ssize_t __pyx_t_22;
15183 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
15184 __pyx_pybuffer_v.pybuffer.buf = NULL;
15185 __pyx_pybuffer_v.refcount = 0;
15186 __pyx_pybuffernd_v.data = NULL;
15187 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15188 __pyx_pybuffer_n.pybuffer.buf = NULL;
15189 __pyx_pybuffer_n.refcount = 0;
15190 __pyx_pybuffernd_n.data = NULL;
15191 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
15192 __pyx_pybuffer_dS.pybuffer.buf = NULL;
15193 __pyx_pybuffer_dS.refcount = 0;
15194 __pyx_pybuffernd_dS.data = NULL;
15195 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
15196 __pyx_pybuffer_flux.pybuffer.buf = NULL;
15197 __pyx_pybuffer_flux.refcount = 0;
15198 __pyx_pybuffernd_flux.data = NULL;
15199 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
15201 __Pyx_BufFmt_StackElem __pyx_stack[1];
15202 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15204 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
15206 __Pyx_BufFmt_StackElem __pyx_stack[1];
15207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15209 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
15211 __Pyx_BufFmt_StackElem __pyx_stack[1];
15212 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15214 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
15216 __Pyx_BufFmt_StackElem __pyx_stack[1];
15217 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 717, __pyx_L1_error)
15219 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
15228 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
15229 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
15230 __pyx_v_eN = __pyx_t_2;
15239 __pyx_t_3 = (__pyx_v_n->dimensions[1]);
15240 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15241 __pyx_v_ebN = __pyx_t_4;
15250 __pyx_v_integral = 0.0;
15259 __pyx_t_5 = (__pyx_v_n->dimensions[2]);
15260 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
15261 __pyx_v_kb = __pyx_t_6;
15270 __pyx_t_7 = (__pyx_v_n->dimensions[3]);
15271 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
15272 __pyx_v_I = __pyx_t_8;
15281 __pyx_t_9 = __pyx_v_eN;
15282 __pyx_t_10 = __pyx_v_ebN;
15283 __pyx_t_11 = __pyx_v_kb;
15284 __pyx_t_12 = __pyx_v_I;
15286 if (__pyx_t_9 < 0) {
15287 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[0].shape;
15288 if (unlikely(__pyx_t_9 < 0)) __pyx_t_13 = 0;
15289 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_13 = 0;
15290 if (__pyx_t_10 < 0) {
15291 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[1].shape;
15292 if (unlikely(__pyx_t_10 < 0)) __pyx_t_13 = 1;
15293 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_13 = 1;
15294 if (__pyx_t_11 < 0) {
15295 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[2].shape;
15296 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 2;
15297 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_13 = 2;
15298 if (__pyx_t_12 < 0) {
15299 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[3].shape;
15300 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 3;
15301 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_13 = 3;
15302 if (unlikely(__pyx_t_13 != -1)) {
15303 __Pyx_RaiseBufferIndexError(__pyx_t_13);
15304 __PYX_ERR(0, 729, __pyx_L1_error)
15306 __pyx_t_14 = __pyx_v_eN;
15307 __pyx_t_15 = __pyx_v_ebN;
15308 __pyx_t_16 = __pyx_v_kb;
15309 __pyx_t_17 = __pyx_v_I;
15311 if (__pyx_t_14 < 0) {
15312 __pyx_t_14 += __pyx_pybuffernd_n.diminfo[0].shape;
15313 if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
15314 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_13 = 0;
15315 if (__pyx_t_15 < 0) {
15316 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[1].shape;
15317 if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
15318 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_13 = 1;
15319 if (__pyx_t_16 < 0) {
15320 __pyx_t_16 += __pyx_pybuffernd_n.diminfo[2].shape;
15321 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 2;
15322 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_13 = 2;
15323 if (__pyx_t_17 < 0) {
15324 __pyx_t_17 += __pyx_pybuffernd_n.diminfo[3].shape;
15325 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 3;
15326 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_13 = 3;
15327 if (unlikely(__pyx_t_13 != -1)) {
15328 __Pyx_RaiseBufferIndexError(__pyx_t_13);
15329 __PYX_ERR(0, 729, __pyx_L1_error)
15331 __pyx_t_18 = __pyx_v_eN;
15332 __pyx_t_19 = __pyx_v_ebN;
15333 __pyx_t_20 = __pyx_v_kb;
15335 if (__pyx_t_18 < 0) {
15336 __pyx_t_18 += __pyx_pybuffernd_dS.diminfo[0].shape;
15337 if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
15338 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_13 = 0;
15339 if (__pyx_t_19 < 0) {
15340 __pyx_t_19 += __pyx_pybuffernd_dS.diminfo[1].shape;
15341 if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 1;
15342 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_13 = 1;
15343 if (__pyx_t_20 < 0) {
15344 __pyx_t_20 += __pyx_pybuffernd_dS.diminfo[2].shape;
15345 if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 2;
15346 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_13 = 2;
15347 if (unlikely(__pyx_t_13 != -1)) {
15348 __Pyx_RaiseBufferIndexError(__pyx_t_13);
15349 __PYX_ERR(0, 729, __pyx_L1_error)
15351 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_17, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_dS.diminfo[2].strides))));
15362 __pyx_t_21 = __pyx_v_eN;
15363 __pyx_t_22 = __pyx_v_ebN;
15365 if (__pyx_t_21 < 0) {
15366 __pyx_t_21 += __pyx_pybuffernd_flux.diminfo[0].shape;
15367 if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0;
15368 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_6 = 0;
15369 if (__pyx_t_22 < 0) {
15370 __pyx_t_22 += __pyx_pybuffernd_flux.diminfo[1].shape;
15371 if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 1;
15372 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_6 = 1;
15373 if (unlikely(__pyx_t_6 != -1)) {
15374 __Pyx_RaiseBufferIndexError(__pyx_t_6);
15375 __PYX_ERR(0, 730, __pyx_L1_error)
15377 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
15390 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15393 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15394 __Pyx_PyThreadState_declare
15395 __Pyx_PyThreadState_assign
15396 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15397 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15398 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15399 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15400 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15401 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15402 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
15406 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
15407 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
15408 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
15409 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
15411 __Pyx_XGIVEREF(__pyx_r);
15412 __Pyx_RefNannyFinishContext();
15425 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15426 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
15427 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
15428 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15429 PyArrayObject *__pyx_v_df = 0;
15430 PyArrayObject *__pyx_v_characteristic_velocity = 0;
15431 PyArrayObject *__pyx_v_dm = 0;
15432 PyArrayObject *__pyx_v_dV = 0;
15433 PyObject *__pyx_r = 0;
15434 __Pyx_RefNannyDeclarations
15435 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
15437 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
15438 PyObject* values[4] = {0,0,0,0};
15439 if (unlikely(__pyx_kwds)) {
15440 Py_ssize_t kw_args;
15441 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15442 switch (pos_args) {
15443 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15444 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15445 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15446 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15448 default:
goto __pyx_L5_argtuple_error;
15450 kw_args = PyDict_Size(__pyx_kwds);
15451 switch (pos_args) {
15453 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
15454 else goto __pyx_L5_argtuple_error;
15456 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
15458 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); __PYX_ERR(0, 732, __pyx_L3_error)
15461 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
15463 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); __PYX_ERR(0, 732, __pyx_L3_error)
15466 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15468 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); __PYX_ERR(0, 732, __pyx_L3_error)
15471 if (unlikely(kw_args > 0)) {
15472 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) __PYX_ERR(0, 732, __pyx_L3_error)
15474 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
15475 goto __pyx_L5_argtuple_error;
15477 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15478 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15479 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15480 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15482 __pyx_v_df = ((PyArrayObject *)values[0]);
15483 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
15484 __pyx_v_dm = ((PyArrayObject *)values[2]);
15485 __pyx_v_dV = ((PyArrayObject *)values[3]);
15487 goto __pyx_L4_argument_unpacking_done;
15488 __pyx_L5_argtuple_error:;
15489 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 732, __pyx_L3_error)
15491 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
15492 __Pyx_RefNannyFinishContext();
15494 __pyx_L4_argument_unpacking_done:;
15495 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) __PYX_ERR(0, 732, __pyx_L1_error)
15496 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) __PYX_ERR(0, 733, __pyx_L1_error)
15497 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 734, __pyx_L1_error)
15498 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 735, __pyx_L1_error)
15499 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
15506 __Pyx_RefNannyFinishContext();
15510 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
15514 double __pyx_v_omega_e;
15515 double __pyx_v_vol_e;
15516 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
15517 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
15518 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15519 __Pyx_Buffer __pyx_pybuffer_dV;
15520 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
15521 __Pyx_Buffer __pyx_pybuffer_df;
15522 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
15523 __Pyx_Buffer __pyx_pybuffer_dm;
15524 PyObject *__pyx_r = NULL;
15525 __Pyx_RefNannyDeclarations
15526 npy_intp __pyx_t_1;
15528 npy_intp __pyx_t_3;
15530 Py_ssize_t __pyx_t_5;
15531 Py_ssize_t __pyx_t_6;
15533 Py_ssize_t __pyx_t_8;
15534 Py_ssize_t __pyx_t_9;
15535 Py_ssize_t __pyx_t_10;
15536 Py_ssize_t __pyx_t_11;
15537 npy_intp __pyx_t_12;
15538 Py_ssize_t __pyx_t_13;
15539 Py_ssize_t __pyx_t_14;
15540 Py_ssize_t __pyx_t_15;
15542 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
15544 Py_ssize_t __pyx_t_19;
15545 Py_ssize_t __pyx_t_20;
15546 Py_ssize_t __pyx_t_21;
15547 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
15548 __pyx_pybuffer_df.pybuffer.buf = NULL;
15549 __pyx_pybuffer_df.refcount = 0;
15550 __pyx_pybuffernd_df.data = NULL;
15551 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
15552 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
15553 __pyx_pybuffer_characteristic_velocity.refcount = 0;
15554 __pyx_pybuffernd_characteristic_velocity.data = NULL;
15555 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
15556 __pyx_pybuffer_dm.pybuffer.buf = NULL;
15557 __pyx_pybuffer_dm.refcount = 0;
15558 __pyx_pybuffernd_dm.data = NULL;
15559 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
15560 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15561 __pyx_pybuffer_dV.refcount = 0;
15562 __pyx_pybuffernd_dV.data = NULL;
15563 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15565 __Pyx_BufFmt_StackElem __pyx_stack[1];
15566 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
15568 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
15570 __Pyx_BufFmt_StackElem __pyx_stack[1];
15571 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
15573 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
15575 __Pyx_BufFmt_StackElem __pyx_stack[1];
15576 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
15578 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
15580 __Pyx_BufFmt_StackElem __pyx_stack[1];
15581 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 732, __pyx_L1_error)
15583 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15592 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
15593 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
15594 __pyx_v_eN = __pyx_t_2;
15603 __pyx_v_omega_e = 0.0;
15612 __pyx_v_vol_e = 0.0;
15621 __pyx_t_3 = (__pyx_v_dm->dimensions[1]);
15622 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15623 __pyx_v_k = __pyx_t_4;
15632 __pyx_t_5 = __pyx_v_eN;
15633 __pyx_t_6 = __pyx_v_k;
15635 if (__pyx_t_5 < 0) {
15636 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
15637 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
15638 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
15639 if (__pyx_t_6 < 0) {
15640 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
15641 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
15642 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
15643 if (unlikely(__pyx_t_7 != -1)) {
15644 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15645 __PYX_ERR(0, 747, __pyx_L1_error)
15647 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
15656 __pyx_t_8 = __pyx_v_eN;
15657 __pyx_t_9 = __pyx_v_k;
15659 if (__pyx_t_8 < 0) {
15660 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15661 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
15662 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
15663 if (__pyx_t_9 < 0) {
15664 __pyx_t_9 += __pyx_pybuffernd_dV.diminfo[1].shape;
15665 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
15666 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
15667 if (unlikely(__pyx_t_7 != -1)) {
15668 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15669 __PYX_ERR(0, 748, __pyx_L1_error)
15671 __pyx_t_10 = __pyx_v_eN;
15672 __pyx_t_11 = __pyx_v_k;
15674 if (__pyx_t_10 < 0) {
15675 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
15676 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
15677 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_7 = 0;
15678 if (__pyx_t_11 < 0) {
15679 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
15680 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
15681 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_7 = 1;
15682 if (unlikely(__pyx_t_7 != -1)) {
15683 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15684 __PYX_ERR(0, 748, __pyx_L1_error)
15686 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
15696 __pyx_t_3 = (__pyx_v_df->dimensions[1]);
15697 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15698 __pyx_v_k = __pyx_t_4;
15707 __pyx_t_12 = (__pyx_v_df->dimensions[2]);
15708 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
15709 __pyx_v_I = __pyx_t_7;
15718 __pyx_t_13 = __pyx_v_eN;
15719 __pyx_t_14 = __pyx_v_k;
15720 __pyx_t_15 = __pyx_v_I;
15722 if (__pyx_t_13 < 0) {
15723 __pyx_t_13 += __pyx_pybuffernd_df.diminfo[0].shape;
15724 if (unlikely(__pyx_t_13 < 0)) __pyx_t_16 = 0;
15725 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_16 = 0;
15726 if (__pyx_t_14 < 0) {
15727 __pyx_t_14 += __pyx_pybuffernd_df.diminfo[1].shape;
15728 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 1;
15729 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_16 = 1;
15730 if (__pyx_t_15 < 0) {
15731 __pyx_t_15 += __pyx_pybuffernd_df.diminfo[2].shape;
15732 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 2;
15733 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_16 = 2;
15734 if (unlikely(__pyx_t_16 != -1)) {
15735 __Pyx_RaiseBufferIndexError(__pyx_t_16);
15736 __PYX_ERR(0, 751, __pyx_L1_error)
15738 __pyx_t_17 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
15739 __pyx_t_18 = (__pyx_v_omega_e + 1.0e-12);
15740 if (unlikely(__pyx_t_18 == 0)) {
15741 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15742 __PYX_ERR(0, 751, __pyx_L1_error)
15744 __pyx_t_19 = __pyx_v_eN;
15745 __pyx_t_20 = __pyx_v_k;
15746 __pyx_t_21 = __pyx_v_I;
15748 if (__pyx_t_19 < 0) {
15749 __pyx_t_19 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
15750 if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
15751 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_16 = 0;
15752 if (__pyx_t_20 < 0) {
15753 __pyx_t_20 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
15754 if (unlikely(__pyx_t_20 < 0)) __pyx_t_16 = 1;
15755 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_16 = 1;
15756 if (__pyx_t_21 < 0) {
15757 __pyx_t_21 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
15758 if (unlikely(__pyx_t_21 < 0)) __pyx_t_16 = 2;
15759 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_16 = 2;
15760 if (unlikely(__pyx_t_16 != -1)) {
15761 __Pyx_RaiseBufferIndexError(__pyx_t_16);
15762 __PYX_ERR(0, 751, __pyx_L1_error)
15764 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_17 / __pyx_t_18);
15778 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15781 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15782 __Pyx_PyThreadState_declare
15783 __Pyx_PyThreadState_assign
15784 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15785 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
15786 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15787 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
15788 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15789 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15790 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
15794 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
15795 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15796 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
15797 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15799 __Pyx_XGIVEREF(__pyx_r);
15800 __Pyx_RefNannyFinishContext();
15813 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15814 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
15815 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
15816 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15817 PyArrayObject *__pyx_v_df_dofs = 0;
15818 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
15819 PyArrayObject *__pyx_v_l2g = 0;
15820 PyArrayObject *__pyx_v_dm = 0;
15821 PyArrayObject *__pyx_v_dV = 0;
15822 PyObject *__pyx_r = 0;
15823 __Pyx_RefNannyDeclarations
15824 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
15826 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
15827 PyObject* values[5] = {0,0,0,0,0};
15828 if (unlikely(__pyx_kwds)) {
15829 Py_ssize_t kw_args;
15830 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15831 switch (pos_args) {
15832 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15833 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15834 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15835 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15836 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15838 default:
goto __pyx_L5_argtuple_error;
15840 kw_args = PyDict_Size(__pyx_kwds);
15841 switch (pos_args) {
15843 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
15844 else goto __pyx_L5_argtuple_error;
15846 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
15848 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); __PYX_ERR(0, 753, __pyx_L3_error)
15851 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
15853 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); __PYX_ERR(0, 753, __pyx_L3_error)
15856 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
15858 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); __PYX_ERR(0, 753, __pyx_L3_error)
15861 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15863 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); __PYX_ERR(0, 753, __pyx_L3_error)
15866 if (unlikely(kw_args > 0)) {
15867 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) __PYX_ERR(0, 753, __pyx_L3_error)
15869 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15870 goto __pyx_L5_argtuple_error;
15872 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15873 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15874 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15875 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15876 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15878 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
15879 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
15880 __pyx_v_l2g = ((PyArrayObject *)values[2]);
15881 __pyx_v_dm = ((PyArrayObject *)values[3]);
15882 __pyx_v_dV = ((PyArrayObject *)values[4]);
15884 goto __pyx_L4_argument_unpacking_done;
15885 __pyx_L5_argtuple_error:;
15886 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
15888 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
15889 __Pyx_RefNannyFinishContext();
15891 __pyx_L4_argument_unpacking_done:;
15892 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) __PYX_ERR(0, 753, __pyx_L1_error)
15893 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) __PYX_ERR(0, 754, __pyx_L1_error)
15894 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) __PYX_ERR(0, 755, __pyx_L1_error)
15895 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) __PYX_ERR(0, 756, __pyx_L1_error)
15896 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) __PYX_ERR(0, 757, __pyx_L1_error)
15897 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
15904 __Pyx_RefNannyFinishContext();
15908 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
15913 double __pyx_v_omega_e;
15914 double __pyx_v_vol_e;
15915 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
15916 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
15917 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15918 __Pyx_Buffer __pyx_pybuffer_dV;
15919 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
15920 __Pyx_Buffer __pyx_pybuffer_df_dofs;
15921 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
15922 __Pyx_Buffer __pyx_pybuffer_dm;
15923 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
15924 __Pyx_Buffer __pyx_pybuffer_l2g;
15925 PyObject *__pyx_r = NULL;
15926 __Pyx_RefNannyDeclarations
15927 npy_intp __pyx_t_1;
15929 npy_intp __pyx_t_3;
15931 Py_ssize_t __pyx_t_5;
15932 Py_ssize_t __pyx_t_6;
15934 Py_ssize_t __pyx_t_8;
15935 Py_ssize_t __pyx_t_9;
15936 Py_ssize_t __pyx_t_10;
15937 Py_ssize_t __pyx_t_11;
15938 Py_ssize_t __pyx_t_12;
15939 Py_ssize_t __pyx_t_13;
15940 Py_ssize_t __pyx_t_14;
15941 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
15943 Py_ssize_t __pyx_t_17;
15944 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
15945 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
15946 __pyx_pybuffer_df_dofs.refcount = 0;
15947 __pyx_pybuffernd_df_dofs.data = NULL;
15948 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
15949 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
15950 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
15951 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
15952 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
15953 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
15954 __pyx_pybuffer_l2g.refcount = 0;
15955 __pyx_pybuffernd_l2g.data = NULL;
15956 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
15957 __pyx_pybuffer_dm.pybuffer.buf = NULL;
15958 __pyx_pybuffer_dm.refcount = 0;
15959 __pyx_pybuffernd_dm.data = NULL;
15960 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
15961 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15962 __pyx_pybuffer_dV.refcount = 0;
15963 __pyx_pybuffernd_dV.data = NULL;
15964 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15966 __Pyx_BufFmt_StackElem __pyx_stack[1];
15967 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
15969 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
15971 __Pyx_BufFmt_StackElem __pyx_stack[1];
15972 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
15974 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
15976 __Pyx_BufFmt_StackElem __pyx_stack[1];
15977 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
15979 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
15981 __Pyx_BufFmt_StackElem __pyx_stack[1];
15982 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
15984 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
15986 __Pyx_BufFmt_StackElem __pyx_stack[1];
15987 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 753, __pyx_L1_error)
15989 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15998 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
15999 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
16000 __pyx_v_eN = __pyx_t_2;
16009 __pyx_v_omega_e = 0.0;
16018 __pyx_v_vol_e = 0.0;
16027 __pyx_t_3 = (__pyx_v_dm->dimensions[1]);
16028 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16029 __pyx_v_k = __pyx_t_4;
16038 __pyx_t_5 = __pyx_v_eN;
16039 __pyx_t_6 = __pyx_v_k;
16041 if (__pyx_t_5 < 0) {
16042 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
16043 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
16044 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
16045 if (__pyx_t_6 < 0) {
16046 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
16047 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
16048 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
16049 if (unlikely(__pyx_t_7 != -1)) {
16050 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16051 __PYX_ERR(0, 769, __pyx_L1_error)
16053 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
16062 __pyx_t_8 = __pyx_v_eN;
16063 __pyx_t_9 = __pyx_v_k;
16065 if (__pyx_t_8 < 0) {
16066 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
16067 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
16068 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
16069 if (__pyx_t_9 < 0) {
16070 __pyx_t_9 += __pyx_pybuffernd_dV.diminfo[1].shape;
16071 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
16072 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
16073 if (unlikely(__pyx_t_7 != -1)) {
16074 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16075 __PYX_ERR(0, 770, __pyx_L1_error)
16077 __pyx_t_10 = __pyx_v_eN;
16078 __pyx_t_11 = __pyx_v_k;
16080 if (__pyx_t_10 < 0) {
16081 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
16082 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
16083 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_7 = 0;
16084 if (__pyx_t_11 < 0) {
16085 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
16086 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
16087 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_7 = 1;
16088 if (unlikely(__pyx_t_7 != -1)) {
16089 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16090 __PYX_ERR(0, 770, __pyx_L1_error)
16092 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
16102 __pyx_t_3 = (__pyx_v_l2g->dimensions[1]);
16103 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16104 __pyx_v_j = __pyx_t_4;
16113 __pyx_t_12 = __pyx_v_eN;
16114 __pyx_t_13 = __pyx_v_j;
16116 if (__pyx_t_12 < 0) {
16117 __pyx_t_12 += __pyx_pybuffernd_l2g.diminfo[0].shape;
16118 if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
16119 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_7 = 0;
16120 if (__pyx_t_13 < 0) {
16121 __pyx_t_13 += __pyx_pybuffernd_l2g.diminfo[1].shape;
16122 if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 1;
16123 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_7 = 1;
16124 if (unlikely(__pyx_t_7 != -1)) {
16125 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16126 __PYX_ERR(0, 772, __pyx_L1_error)
16128 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_l2g.diminfo[1].strides));
16137 __pyx_t_14 = __pyx_v_J;
16139 if (__pyx_t_14 < 0) {
16140 __pyx_t_14 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
16141 if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
16142 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_7 = 0;
16143 if (unlikely(__pyx_t_7 != -1)) {
16144 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16145 __PYX_ERR(0, 773, __pyx_L1_error)
16147 __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
16148 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
16149 if (unlikely(__pyx_t_16 == 0)) {
16150 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16151 __PYX_ERR(0, 773, __pyx_L1_error)
16153 __pyx_t_17 = __pyx_v_J;
16155 if (__pyx_t_17 < 0) {
16156 __pyx_t_17 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
16157 if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
16158 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_7 = 0;
16159 if (unlikely(__pyx_t_7 != -1)) {
16160 __Pyx_RaiseBufferIndexError(__pyx_t_7);
16161 __PYX_ERR(0, 773, __pyx_L1_error)
16163 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_15 / __pyx_t_16);
16176 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16179 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16180 __Pyx_PyThreadState_declare
16181 __Pyx_PyThreadState_assign
16182 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16183 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16184 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16185 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16186 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16187 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16188 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16189 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
16193 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
16194 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
16195 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
16196 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
16197 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
16199 __Pyx_XGIVEREF(__pyx_r);
16200 __Pyx_RefNannyFinishContext();
16213 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16214 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
16215 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16216 int __pyx_v_transient;
16218 double __pyx_v_tForReversal;
16219 double __pyx_v_clock;
16222 PyArrayObject *__pyx_v_x = 0;
16223 PyArrayObject *__pyx_v_v = 0;
16224 double __pyx_v_zvelocity;
16225 PyObject *__pyx_r = 0;
16226 __Pyx_RefNannyDeclarations
16227 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
16229 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16230 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16231 if (unlikely(__pyx_kwds)) {
16232 Py_ssize_t kw_args;
16233 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16234 switch (pos_args) {
16235 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16236 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16237 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16238 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16239 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16240 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16241 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16242 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16243 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16245 default:
goto __pyx_L5_argtuple_error;
16247 kw_args = PyDict_Size(__pyx_kwds);
16248 switch (pos_args) {
16250 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16251 else goto __pyx_L5_argtuple_error;
16253 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16255 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); __PYX_ERR(0, 776, __pyx_L3_error)
16258 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16260 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); __PYX_ERR(0, 776, __pyx_L3_error)
16263 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16265 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); __PYX_ERR(0, 776, __pyx_L3_error)
16268 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16270 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); __PYX_ERR(0, 776, __pyx_L3_error)
16273 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16275 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); __PYX_ERR(0, 776, __pyx_L3_error)
16278 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16280 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); __PYX_ERR(0, 776, __pyx_L3_error)
16283 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16285 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); __PYX_ERR(0, 776, __pyx_L3_error)
16289 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zvelocity);
16290 if (value) { values[8] = value; kw_args--; }
16293 if (unlikely(kw_args > 0)) {
16294 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) __PYX_ERR(0, 776, __pyx_L3_error)
16297 switch (PyTuple_GET_SIZE(__pyx_args)) {
16298 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16299 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16300 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16301 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16302 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16303 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16304 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16305 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16306 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16308 default:
goto __pyx_L5_argtuple_error;
16311 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 776, __pyx_L3_error)
16312 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 777, __pyx_L3_error)
16313 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error)
16314 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error)
16315 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16316 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L3_error)
16317 __pyx_v_x = ((PyArrayObject *)values[6]);
16318 __pyx_v_v = ((PyArrayObject *)values[7]);
16320 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 783, __pyx_L3_error)
16322 __pyx_v_zvelocity = ((double)0.0);
16325 goto __pyx_L4_argument_unpacking_done;
16326 __pyx_L5_argtuple_error:;
16327 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 776, __pyx_L3_error)
16329 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16330 __Pyx_RefNannyFinishContext();
16332 __pyx_L4_argument_unpacking_done:;
16333 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 781, __pyx_L1_error)
16334 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 782, __pyx_L1_error)
16335 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
16342 __Pyx_RefNannyFinishContext();
16346 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
16350 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
16351 __Pyx_Buffer __pyx_pybuffer_v;
16352 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
16353 __Pyx_Buffer __pyx_pybuffer_x;
16354 PyObject *__pyx_r = NULL;
16355 __Pyx_RefNannyDeclarations
16357 npy_intp __pyx_t_2;
16359 npy_intp __pyx_t_4;
16361 Py_ssize_t __pyx_t_6;
16362 Py_ssize_t __pyx_t_7;
16363 Py_ssize_t __pyx_t_8;
16365 Py_ssize_t __pyx_t_10;
16366 Py_ssize_t __pyx_t_11;
16367 Py_ssize_t __pyx_t_12;
16368 Py_ssize_t __pyx_t_13;
16369 Py_ssize_t __pyx_t_14;
16370 Py_ssize_t __pyx_t_15;
16371 Py_ssize_t __pyx_t_16;
16372 Py_ssize_t __pyx_t_17;
16373 Py_ssize_t __pyx_t_18;
16374 Py_ssize_t __pyx_t_19;
16375 Py_ssize_t __pyx_t_20;
16376 Py_ssize_t __pyx_t_21;
16377 PyObject *__pyx_t_22 = NULL;
16378 PyObject *__pyx_t_23 = NULL;
16379 PyObject *__pyx_t_24 = NULL;
16382 PyObject *__pyx_t_27 = NULL;
16383 Py_ssize_t __pyx_t_28;
16384 Py_ssize_t __pyx_t_29;
16385 Py_ssize_t __pyx_t_30;
16386 Py_ssize_t __pyx_t_31;
16387 Py_ssize_t __pyx_t_32;
16388 Py_ssize_t __pyx_t_33;
16389 Py_ssize_t __pyx_t_34;
16390 Py_ssize_t __pyx_t_35;
16391 Py_ssize_t __pyx_t_36;
16392 Py_ssize_t __pyx_t_37;
16393 Py_ssize_t __pyx_t_38;
16394 Py_ssize_t __pyx_t_39;
16395 Py_ssize_t __pyx_t_40;
16396 Py_ssize_t __pyx_t_41;
16397 Py_ssize_t __pyx_t_42;
16398 Py_ssize_t __pyx_t_43;
16399 Py_ssize_t __pyx_t_44;
16400 Py_ssize_t __pyx_t_45;
16401 Py_ssize_t __pyx_t_46;
16402 Py_ssize_t __pyx_t_47;
16403 Py_ssize_t __pyx_t_48;
16404 Py_ssize_t __pyx_t_49;
16405 Py_ssize_t __pyx_t_50;
16406 Py_ssize_t __pyx_t_51;
16407 Py_ssize_t __pyx_t_52;
16408 Py_ssize_t __pyx_t_53;
16409 Py_ssize_t __pyx_t_54;
16410 Py_ssize_t __pyx_t_55;
16411 Py_ssize_t __pyx_t_56;
16412 Py_ssize_t __pyx_t_57;
16413 Py_ssize_t __pyx_t_58;
16414 Py_ssize_t __pyx_t_59;
16415 Py_ssize_t __pyx_t_60;
16416 Py_ssize_t __pyx_t_61;
16417 Py_ssize_t __pyx_t_62;
16418 Py_ssize_t __pyx_t_63;
16419 Py_ssize_t __pyx_t_64;
16420 Py_ssize_t __pyx_t_65;
16421 Py_ssize_t __pyx_t_66;
16422 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
16423 __pyx_pybuffer_x.pybuffer.buf = NULL;
16424 __pyx_pybuffer_x.refcount = 0;
16425 __pyx_pybuffernd_x.data = NULL;
16426 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
16427 __pyx_pybuffer_v.pybuffer.buf = NULL;
16428 __pyx_pybuffer_v.refcount = 0;
16429 __pyx_pybuffernd_v.data = NULL;
16430 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
16432 __Pyx_BufFmt_StackElem __pyx_stack[1];
16433 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16435 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
16437 __Pyx_BufFmt_StackElem __pyx_stack[1];
16438 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 776, __pyx_L1_error)
16440 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
16458 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
16468 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
16478 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16479 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16480 __pyx_v_eN = __pyx_t_3;
16489 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16490 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16491 __pyx_v_k = __pyx_t_5;
16500 __pyx_t_6 = __pyx_v_eN;
16501 __pyx_t_7 = __pyx_v_k;
16504 if (__pyx_t_6 < 0) {
16505 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[0].shape;
16506 if (unlikely(__pyx_t_6 < 0)) __pyx_t_9 = 0;
16507 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16508 if (__pyx_t_7 < 0) {
16509 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[1].shape;
16510 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
16511 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16512 if (__pyx_t_8 < 0) {
16513 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
16514 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
16515 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16516 if (unlikely(__pyx_t_9 != -1)) {
16517 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16518 __PYX_ERR(0, 791, __pyx_L1_error)
16520 __pyx_t_10 = __pyx_v_eN;
16521 __pyx_t_11 = __pyx_v_k;
16524 if (__pyx_t_10 < 0) {
16525 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
16526 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
16527 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16528 if (__pyx_t_11 < 0) {
16529 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[1].shape;
16530 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
16531 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16532 if (__pyx_t_12 < 0) {
16533 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
16534 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 2;
16535 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16536 if (unlikely(__pyx_t_9 != -1)) {
16537 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16538 __PYX_ERR(0, 791, __pyx_L1_error)
16540 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
16549 __pyx_t_13 = __pyx_v_eN;
16550 __pyx_t_14 = __pyx_v_k;
16553 if (__pyx_t_13 < 0) {
16554 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
16555 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
16556 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16557 if (__pyx_t_14 < 0) {
16558 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[1].shape;
16559 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
16560 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16561 if (__pyx_t_15 < 0) {
16562 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[2].shape;
16563 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 2;
16564 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16565 if (unlikely(__pyx_t_9 != -1)) {
16566 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16567 __PYX_ERR(0, 792, __pyx_L1_error)
16569 __pyx_t_16 = __pyx_v_eN;
16570 __pyx_t_17 = __pyx_v_k;
16573 if (__pyx_t_16 < 0) {
16574 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
16575 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
16576 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16577 if (__pyx_t_17 < 0) {
16578 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
16579 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
16580 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16581 if (__pyx_t_18 < 0) {
16582 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
16583 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
16584 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16585 if (unlikely(__pyx_t_9 != -1)) {
16586 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16587 __PYX_ERR(0, 792, __pyx_L1_error)
16589 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[2].strides))));
16598 __pyx_t_19 = __pyx_v_eN;
16599 __pyx_t_20 = __pyx_v_k;
16602 if (__pyx_t_19 < 0) {
16603 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
16604 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
16605 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16606 if (__pyx_t_20 < 0) {
16607 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[1].shape;
16608 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
16609 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16610 if (__pyx_t_21 < 0) {
16611 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[2].shape;
16612 if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 2;
16613 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16614 if (unlikely(__pyx_t_9 != -1)) {
16615 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16616 __PYX_ERR(0, 793, __pyx_L1_error)
16618 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
16627 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 794, __pyx_L1_error)
16628 __Pyx_GOTREF(__pyx_t_22);
16629 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 794, __pyx_L1_error)
16630 __Pyx_GOTREF(__pyx_t_23);
16631 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 794, __pyx_L1_error)
16632 __Pyx_GOTREF(__pyx_t_24);
16633 __Pyx_GIVEREF(__pyx_t_22);
16634 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22);
16635 __Pyx_GIVEREF(__pyx_t_23);
16636 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
16637 __Pyx_INCREF(__pyx_slice__3);
16638 __Pyx_GIVEREF(__pyx_slice__3);
16639 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice__3);
16642 __pyx_t_23 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 794, __pyx_L1_error)
16643 __Pyx_GOTREF(__pyx_t_23);
16644 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
16645 __pyx_t_26 = (__pyx_v_tForReversal - 0.0);
16646 if (unlikely(__pyx_t_26 == 0)) {
16647 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16648 __PYX_ERR(0, 794, __pyx_L1_error)
16650 __pyx_t_22 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_26) * __pyx_v_clock));
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 794, __pyx_L1_error)
16651 __Pyx_GOTREF(__pyx_t_22);
16652 __pyx_t_27 = PyNumber_InPlaceMultiply(__pyx_t_23, __pyx_t_22);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 794, __pyx_L1_error)
16653 __Pyx_GOTREF(__pyx_t_27);
16654 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16655 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
16656 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_27) < 0)) __PYX_ERR(0, 794, __pyx_L1_error)
16657 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
16658 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
16680 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16681 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16682 __pyx_v_eN = __pyx_t_3;
16691 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16692 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16693 __pyx_v_k = __pyx_t_5;
16702 __pyx_t_28 = __pyx_v_eN;
16703 __pyx_t_29 = __pyx_v_k;
16706 if (__pyx_t_28 < 0) {
16707 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
16708 if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
16709 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16710 if (__pyx_t_29 < 0) {
16711 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
16712 if (unlikely(__pyx_t_29 < 0)) __pyx_t_9 = 1;
16713 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16714 if (__pyx_t_30 < 0) {
16715 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
16716 if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 2;
16717 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16718 if (unlikely(__pyx_t_9 != -1)) {
16719 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16720 __PYX_ERR(0, 798, __pyx_L1_error)
16722 __pyx_t_31 = __pyx_v_eN;
16723 __pyx_t_32 = __pyx_v_k;
16726 if (__pyx_t_31 < 0) {
16727 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[0].shape;
16728 if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
16729 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16730 if (__pyx_t_32 < 0) {
16731 __pyx_t_32 += __pyx_pybuffernd_v.diminfo[1].shape;
16732 if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 1;
16733 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16734 if (__pyx_t_33 < 0) {
16735 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[2].shape;
16736 if (unlikely(__pyx_t_33 < 0)) __pyx_t_9 = 2;
16737 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16738 if (unlikely(__pyx_t_9 != -1)) {
16739 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16740 __PYX_ERR(0, 798, __pyx_L1_error)
16742 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
16751 __pyx_t_34 = __pyx_v_eN;
16752 __pyx_t_35 = __pyx_v_k;
16755 if (__pyx_t_34 < 0) {
16756 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[0].shape;
16757 if (unlikely(__pyx_t_34 < 0)) __pyx_t_9 = 0;
16758 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16759 if (__pyx_t_35 < 0) {
16760 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[1].shape;
16761 if (unlikely(__pyx_t_35 < 0)) __pyx_t_9 = 1;
16762 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16763 if (__pyx_t_36 < 0) {
16764 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[2].shape;
16765 if (unlikely(__pyx_t_36 < 0)) __pyx_t_9 = 2;
16766 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16767 if (unlikely(__pyx_t_9 != -1)) {
16768 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16769 __PYX_ERR(0, 799, __pyx_L1_error)
16771 __pyx_t_37 = __pyx_v_eN;
16772 __pyx_t_38 = __pyx_v_k;
16775 if (__pyx_t_37 < 0) {
16776 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[0].shape;
16777 if (unlikely(__pyx_t_37 < 0)) __pyx_t_9 = 0;
16778 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16779 if (__pyx_t_38 < 0) {
16780 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[1].shape;
16781 if (unlikely(__pyx_t_38 < 0)) __pyx_t_9 = 1;
16782 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16783 if (__pyx_t_39 < 0) {
16784 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[2].shape;
16785 if (unlikely(__pyx_t_39 < 0)) __pyx_t_9 = 2;
16786 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16787 if (unlikely(__pyx_t_9 != -1)) {
16788 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16789 __PYX_ERR(0, 799, __pyx_L1_error)
16791 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[2].strides))));
16800 __pyx_t_40 = __pyx_v_eN;
16801 __pyx_t_41 = __pyx_v_k;
16804 if (__pyx_t_40 < 0) {
16805 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[0].shape;
16806 if (unlikely(__pyx_t_40 < 0)) __pyx_t_9 = 0;
16807 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16808 if (__pyx_t_41 < 0) {
16809 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[1].shape;
16810 if (unlikely(__pyx_t_41 < 0)) __pyx_t_9 = 1;
16811 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16812 if (__pyx_t_42 < 0) {
16813 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[2].shape;
16814 if (unlikely(__pyx_t_42 < 0)) __pyx_t_9 = 2;
16815 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16816 if (unlikely(__pyx_t_9 != -1)) {
16817 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16818 __PYX_ERR(0, 800, __pyx_L1_error)
16820 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
16844 #ifndef CYTHON_WITHOUT_ASSERTIONS 16845 if (unlikely(!Py_OptimizeFlag)) {
16846 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
16847 PyErr_SetNone(PyExc_AssertionError);
16848 __PYX_ERR(0, 802, __pyx_L1_error)
16860 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
16870 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16871 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16872 __pyx_v_eN = __pyx_t_3;
16881 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16882 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16883 __pyx_v_k = __pyx_t_5;
16892 __pyx_t_43 = __pyx_v_eN;
16893 __pyx_t_44 = __pyx_v_k;
16896 if (__pyx_t_43 < 0) {
16897 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
16898 if (unlikely(__pyx_t_43 < 0)) __pyx_t_9 = 0;
16899 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16900 if (__pyx_t_44 < 0) {
16901 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
16902 if (unlikely(__pyx_t_44 < 0)) __pyx_t_9 = 1;
16903 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16904 if (__pyx_t_45 < 0) {
16905 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
16906 if (unlikely(__pyx_t_45 < 0)) __pyx_t_9 = 2;
16907 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16908 if (unlikely(__pyx_t_9 != -1)) {
16909 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16910 __PYX_ERR(0, 806, __pyx_L1_error)
16912 __pyx_t_46 = __pyx_v_eN;
16913 __pyx_t_47 = __pyx_v_k;
16916 if (__pyx_t_46 < 0) {
16917 __pyx_t_46 += __pyx_pybuffernd_v.diminfo[0].shape;
16918 if (unlikely(__pyx_t_46 < 0)) __pyx_t_9 = 0;
16919 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16920 if (__pyx_t_47 < 0) {
16921 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[1].shape;
16922 if (unlikely(__pyx_t_47 < 0)) __pyx_t_9 = 1;
16923 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16924 if (__pyx_t_48 < 0) {
16925 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[2].shape;
16926 if (unlikely(__pyx_t_48 < 0)) __pyx_t_9 = 2;
16927 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16928 if (unlikely(__pyx_t_9 != -1)) {
16929 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16930 __PYX_ERR(0, 806, __pyx_L1_error)
16932 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
16941 __pyx_t_49 = __pyx_v_eN;
16942 __pyx_t_50 = __pyx_v_k;
16945 if (__pyx_t_49 < 0) {
16946 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[0].shape;
16947 if (unlikely(__pyx_t_49 < 0)) __pyx_t_9 = 0;
16948 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16949 if (__pyx_t_50 < 0) {
16950 __pyx_t_50 += __pyx_pybuffernd_x.diminfo[1].shape;
16951 if (unlikely(__pyx_t_50 < 0)) __pyx_t_9 = 1;
16952 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16953 if (__pyx_t_51 < 0) {
16954 __pyx_t_51 += __pyx_pybuffernd_x.diminfo[2].shape;
16955 if (unlikely(__pyx_t_51 < 0)) __pyx_t_9 = 2;
16956 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16957 if (unlikely(__pyx_t_9 != -1)) {
16958 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16959 __PYX_ERR(0, 807, __pyx_L1_error)
16961 __pyx_t_52 = __pyx_v_eN;
16962 __pyx_t_53 = __pyx_v_k;
16965 if (__pyx_t_52 < 0) {
16966 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[0].shape;
16967 if (unlikely(__pyx_t_52 < 0)) __pyx_t_9 = 0;
16968 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16969 if (__pyx_t_53 < 0) {
16970 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[1].shape;
16971 if (unlikely(__pyx_t_53 < 0)) __pyx_t_9 = 1;
16972 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16973 if (__pyx_t_54 < 0) {
16974 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[2].shape;
16975 if (unlikely(__pyx_t_54 < 0)) __pyx_t_9 = 2;
16976 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16977 if (unlikely(__pyx_t_9 != -1)) {
16978 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16979 __PYX_ERR(0, 807, __pyx_L1_error)
16981 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_x.diminfo[2].strides))));
16990 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 808, __pyx_L1_error)
16991 __Pyx_GOTREF(__pyx_t_24);
16992 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 808, __pyx_L1_error)
16993 __Pyx_GOTREF(__pyx_t_27);
16994 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 808, __pyx_L1_error)
16995 __Pyx_GOTREF(__pyx_t_22);
16996 __Pyx_GIVEREF(__pyx_t_24);
16997 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_24);
16998 __Pyx_GIVEREF(__pyx_t_27);
16999 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_27);
17000 __Pyx_INCREF(__pyx_slice__4);
17001 __Pyx_GIVEREF(__pyx_slice__4);
17002 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_slice__4);
17005 __pyx_t_27 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 808, __pyx_L1_error)
17006 __Pyx_GOTREF(__pyx_t_27);
17007 __pyx_t_26 = (__pyx_v_tForReversal - __pyx_v_t);
17008 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
17009 if (unlikely(__pyx_t_25 == 0)) {
17010 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17011 __PYX_ERR(0, 808, __pyx_L1_error)
17013 __pyx_t_24 = PyFloat_FromDouble(((__pyx_t_26 / __pyx_t_25) * __pyx_v_clock));
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 808, __pyx_L1_error)
17014 __Pyx_GOTREF(__pyx_t_24);
17015 __pyx_t_23 = PyNumber_InPlaceMultiply(__pyx_t_27, __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 808, __pyx_L1_error)
17016 __Pyx_GOTREF(__pyx_t_23);
17017 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
17018 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
17019 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0)) __PYX_ERR(0, 808, __pyx_L1_error)
17020 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
17021 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
17043 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17044 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17045 __pyx_v_eN = __pyx_t_3;
17054 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17055 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17056 __pyx_v_k = __pyx_t_5;
17065 __pyx_t_55 = __pyx_v_eN;
17066 __pyx_t_56 = __pyx_v_k;
17069 if (__pyx_t_55 < 0) {
17070 __pyx_t_55 += __pyx_pybuffernd_x.diminfo[0].shape;
17071 if (unlikely(__pyx_t_55 < 0)) __pyx_t_9 = 0;
17072 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
17073 if (__pyx_t_56 < 0) {
17074 __pyx_t_56 += __pyx_pybuffernd_x.diminfo[1].shape;
17075 if (unlikely(__pyx_t_56 < 0)) __pyx_t_9 = 1;
17076 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
17077 if (__pyx_t_57 < 0) {
17078 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[2].shape;
17079 if (unlikely(__pyx_t_57 < 0)) __pyx_t_9 = 2;
17080 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
17081 if (unlikely(__pyx_t_9 != -1)) {
17082 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17083 __PYX_ERR(0, 812, __pyx_L1_error)
17085 __pyx_t_58 = __pyx_v_eN;
17086 __pyx_t_59 = __pyx_v_k;
17089 if (__pyx_t_58 < 0) {
17090 __pyx_t_58 += __pyx_pybuffernd_v.diminfo[0].shape;
17091 if (unlikely(__pyx_t_58 < 0)) __pyx_t_9 = 0;
17092 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
17093 if (__pyx_t_59 < 0) {
17094 __pyx_t_59 += __pyx_pybuffernd_v.diminfo[1].shape;
17095 if (unlikely(__pyx_t_59 < 0)) __pyx_t_9 = 1;
17096 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
17097 if (__pyx_t_60 < 0) {
17098 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[2].shape;
17099 if (unlikely(__pyx_t_60 < 0)) __pyx_t_9 = 2;
17100 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
17101 if (unlikely(__pyx_t_9 != -1)) {
17102 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17103 __PYX_ERR(0, 812, __pyx_L1_error)
17105 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17114 __pyx_t_61 = __pyx_v_eN;
17115 __pyx_t_62 = __pyx_v_k;
17118 if (__pyx_t_61 < 0) {
17119 __pyx_t_61 += __pyx_pybuffernd_x.diminfo[0].shape;
17120 if (unlikely(__pyx_t_61 < 0)) __pyx_t_9 = 0;
17121 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
17122 if (__pyx_t_62 < 0) {
17123 __pyx_t_62 += __pyx_pybuffernd_x.diminfo[1].shape;
17124 if (unlikely(__pyx_t_62 < 0)) __pyx_t_9 = 1;
17125 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
17126 if (__pyx_t_63 < 0) {
17127 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[2].shape;
17128 if (unlikely(__pyx_t_63 < 0)) __pyx_t_9 = 2;
17129 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
17130 if (unlikely(__pyx_t_9 != -1)) {
17131 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17132 __PYX_ERR(0, 813, __pyx_L1_error)
17134 __pyx_t_64 = __pyx_v_eN;
17135 __pyx_t_65 = __pyx_v_k;
17138 if (__pyx_t_64 < 0) {
17139 __pyx_t_64 += __pyx_pybuffernd_v.diminfo[0].shape;
17140 if (unlikely(__pyx_t_64 < 0)) __pyx_t_9 = 0;
17141 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
17142 if (__pyx_t_65 < 0) {
17143 __pyx_t_65 += __pyx_pybuffernd_v.diminfo[1].shape;
17144 if (unlikely(__pyx_t_65 < 0)) __pyx_t_9 = 1;
17145 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
17146 if (__pyx_t_66 < 0) {
17147 __pyx_t_66 += __pyx_pybuffernd_v.diminfo[2].shape;
17148 if (unlikely(__pyx_t_66 < 0)) __pyx_t_9 = 2;
17149 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
17150 if (unlikely(__pyx_t_9 != -1)) {
17151 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17152 __PYX_ERR(0, 813, __pyx_L1_error)
17154 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_x.diminfo[2].strides))));
17171 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17174 __Pyx_XDECREF(__pyx_t_22);
17175 __Pyx_XDECREF(__pyx_t_23);
17176 __Pyx_XDECREF(__pyx_t_24);
17177 __Pyx_XDECREF(__pyx_t_27);
17178 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17179 __Pyx_PyThreadState_declare
17180 __Pyx_PyThreadState_assign
17181 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17182 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17183 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17184 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17185 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17189 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17190 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17192 __Pyx_XGIVEREF(__pyx_r);
17193 __Pyx_RefNannyFinishContext();
17206 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17207 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
17208 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17209 int __pyx_v_transient;
17211 double __pyx_v_tForReversal;
17212 double __pyx_v_clock;
17215 PyArrayObject *__pyx_v_x = 0;
17216 PyArrayObject *__pyx_v_v = 0;
17217 double __pyx_v_zvelocity;
17218 PyObject *__pyx_r = 0;
17219 __Pyx_RefNannyDeclarations
17220 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
17222 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
17223 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17224 if (unlikely(__pyx_kwds)) {
17225 Py_ssize_t kw_args;
17226 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17227 switch (pos_args) {
17228 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17229 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17230 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17231 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17232 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17233 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17234 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17235 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17236 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17238 default:
goto __pyx_L5_argtuple_error;
17240 kw_args = PyDict_Size(__pyx_kwds);
17241 switch (pos_args) {
17243 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17244 else goto __pyx_L5_argtuple_error;
17246 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17248 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); __PYX_ERR(0, 816, __pyx_L3_error)
17251 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17253 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); __PYX_ERR(0, 816, __pyx_L3_error)
17256 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17258 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); __PYX_ERR(0, 816, __pyx_L3_error)
17261 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17263 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); __PYX_ERR(0, 816, __pyx_L3_error)
17266 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17268 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); __PYX_ERR(0, 816, __pyx_L3_error)
17271 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17273 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); __PYX_ERR(0, 816, __pyx_L3_error)
17276 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17278 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); __PYX_ERR(0, 816, __pyx_L3_error)
17282 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zvelocity);
17283 if (value) { values[8] = value; kw_args--; }
17286 if (unlikely(kw_args > 0)) {
17287 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) __PYX_ERR(0, 816, __pyx_L3_error)
17290 switch (PyTuple_GET_SIZE(__pyx_args)) {
17291 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17292 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17293 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17294 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17295 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17296 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17297 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17298 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17299 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17301 default:
goto __pyx_L5_argtuple_error;
17304 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L3_error)
17305 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L3_error)
17306 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error)
17307 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 819, __pyx_L3_error)
17308 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17309 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L3_error)
17310 __pyx_v_x = ((PyArrayObject *)values[6]);
17311 __pyx_v_v = ((PyArrayObject *)values[7]);
17313 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 823, __pyx_L3_error)
17315 __pyx_v_zvelocity = ((double)0.0);
17318 goto __pyx_L4_argument_unpacking_done;
17319 __pyx_L5_argtuple_error:;
17320 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 816, __pyx_L3_error)
17322 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17323 __Pyx_RefNannyFinishContext();
17325 __pyx_L4_argument_unpacking_done:;
17326 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 821, __pyx_L1_error)
17327 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 822, __pyx_L1_error)
17328 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
17335 __Pyx_RefNannyFinishContext();
17339 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
17344 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17345 __Pyx_Buffer __pyx_pybuffer_v;
17346 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17347 __Pyx_Buffer __pyx_pybuffer_x;
17348 PyObject *__pyx_r = NULL;
17349 __Pyx_RefNannyDeclarations
17351 npy_intp __pyx_t_2;
17353 npy_intp __pyx_t_4;
17355 npy_intp __pyx_t_6;
17357 Py_ssize_t __pyx_t_8;
17358 Py_ssize_t __pyx_t_9;
17359 Py_ssize_t __pyx_t_10;
17360 Py_ssize_t __pyx_t_11;
17362 Py_ssize_t __pyx_t_13;
17363 Py_ssize_t __pyx_t_14;
17364 Py_ssize_t __pyx_t_15;
17365 Py_ssize_t __pyx_t_16;
17366 Py_ssize_t __pyx_t_17;
17367 Py_ssize_t __pyx_t_18;
17368 Py_ssize_t __pyx_t_19;
17369 Py_ssize_t __pyx_t_20;
17370 Py_ssize_t __pyx_t_21;
17371 Py_ssize_t __pyx_t_22;
17372 Py_ssize_t __pyx_t_23;
17373 Py_ssize_t __pyx_t_24;
17374 Py_ssize_t __pyx_t_25;
17375 Py_ssize_t __pyx_t_26;
17376 Py_ssize_t __pyx_t_27;
17377 Py_ssize_t __pyx_t_28;
17378 PyObject *__pyx_t_29 = NULL;
17379 PyObject *__pyx_t_30 = NULL;
17380 PyObject *__pyx_t_31 = NULL;
17381 PyObject *__pyx_t_32 = NULL;
17384 Py_ssize_t __pyx_t_35;
17385 Py_ssize_t __pyx_t_36;
17386 Py_ssize_t __pyx_t_37;
17387 Py_ssize_t __pyx_t_38;
17388 Py_ssize_t __pyx_t_39;
17389 Py_ssize_t __pyx_t_40;
17390 Py_ssize_t __pyx_t_41;
17391 Py_ssize_t __pyx_t_42;
17392 Py_ssize_t __pyx_t_43;
17393 Py_ssize_t __pyx_t_44;
17394 Py_ssize_t __pyx_t_45;
17395 Py_ssize_t __pyx_t_46;
17396 Py_ssize_t __pyx_t_47;
17397 Py_ssize_t __pyx_t_48;
17398 Py_ssize_t __pyx_t_49;
17399 Py_ssize_t __pyx_t_50;
17400 Py_ssize_t __pyx_t_51;
17401 Py_ssize_t __pyx_t_52;
17402 Py_ssize_t __pyx_t_53;
17403 Py_ssize_t __pyx_t_54;
17404 Py_ssize_t __pyx_t_55;
17405 Py_ssize_t __pyx_t_56;
17406 Py_ssize_t __pyx_t_57;
17407 Py_ssize_t __pyx_t_58;
17408 Py_ssize_t __pyx_t_59;
17409 Py_ssize_t __pyx_t_60;
17410 Py_ssize_t __pyx_t_61;
17411 Py_ssize_t __pyx_t_62;
17412 Py_ssize_t __pyx_t_63;
17413 Py_ssize_t __pyx_t_64;
17414 Py_ssize_t __pyx_t_65;
17415 Py_ssize_t __pyx_t_66;
17416 Py_ssize_t __pyx_t_67;
17417 Py_ssize_t __pyx_t_68;
17418 Py_ssize_t __pyx_t_69;
17419 Py_ssize_t __pyx_t_70;
17420 Py_ssize_t __pyx_t_71;
17421 Py_ssize_t __pyx_t_72;
17422 Py_ssize_t __pyx_t_73;
17423 Py_ssize_t __pyx_t_74;
17424 Py_ssize_t __pyx_t_75;
17425 Py_ssize_t __pyx_t_76;
17426 Py_ssize_t __pyx_t_77;
17427 Py_ssize_t __pyx_t_78;
17428 Py_ssize_t __pyx_t_79;
17429 Py_ssize_t __pyx_t_80;
17430 Py_ssize_t __pyx_t_81;
17431 Py_ssize_t __pyx_t_82;
17432 Py_ssize_t __pyx_t_83;
17433 Py_ssize_t __pyx_t_84;
17434 Py_ssize_t __pyx_t_85;
17435 Py_ssize_t __pyx_t_86;
17436 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
17437 __pyx_pybuffer_x.pybuffer.buf = NULL;
17438 __pyx_pybuffer_x.refcount = 0;
17439 __pyx_pybuffernd_x.data = NULL;
17440 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17441 __pyx_pybuffer_v.pybuffer.buf = NULL;
17442 __pyx_pybuffer_v.refcount = 0;
17443 __pyx_pybuffernd_v.data = NULL;
17444 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17446 __Pyx_BufFmt_StackElem __pyx_stack[1];
17447 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17449 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
17451 __Pyx_BufFmt_StackElem __pyx_stack[1];
17452 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 816, __pyx_L1_error)
17454 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
17472 __pyx_t_1 = (((__pyx_v_v->dimensions[-1L]) == 3) != 0);
17482 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17492 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17493 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17494 __pyx_v_eN = __pyx_t_3;
17503 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17504 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17505 __pyx_v_ebN = __pyx_t_5;
17514 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17515 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17516 __pyx_v_k = __pyx_t_7;
17525 __pyx_t_8 = __pyx_v_eN;
17526 __pyx_t_9 = __pyx_v_ebN;
17527 __pyx_t_10 = __pyx_v_k;
17530 if (__pyx_t_8 < 0) {
17531 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
17532 if (unlikely(__pyx_t_8 < 0)) __pyx_t_12 = 0;
17533 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17534 if (__pyx_t_9 < 0) {
17535 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
17536 if (unlikely(__pyx_t_9 < 0)) __pyx_t_12 = 1;
17537 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17538 if (__pyx_t_10 < 0) {
17539 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
17540 if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 2;
17541 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17542 if (__pyx_t_11 < 0) {
17543 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
17544 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 3;
17545 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17546 if (unlikely(__pyx_t_12 != -1)) {
17547 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17548 __PYX_ERR(0, 832, __pyx_L1_error)
17550 __pyx_t_13 = __pyx_v_eN;
17551 __pyx_t_14 = __pyx_v_ebN;
17552 __pyx_t_15 = __pyx_v_k;
17555 if (__pyx_t_13 < 0) {
17556 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
17557 if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
17558 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17559 if (__pyx_t_14 < 0) {
17560 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
17561 if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 1;
17562 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17563 if (__pyx_t_15 < 0) {
17564 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
17565 if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 2;
17566 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17567 if (__pyx_t_16 < 0) {
17568 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
17569 if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 3;
17570 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17571 if (unlikely(__pyx_t_12 != -1)) {
17572 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17573 __PYX_ERR(0, 832, __pyx_L1_error)
17575 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
17584 __pyx_t_17 = __pyx_v_eN;
17585 __pyx_t_18 = __pyx_v_ebN;
17586 __pyx_t_19 = __pyx_v_k;
17589 if (__pyx_t_17 < 0) {
17590 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape;
17591 if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0;
17592 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17593 if (__pyx_t_18 < 0) {
17594 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[1].shape;
17595 if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 1;
17596 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17597 if (__pyx_t_19 < 0) {
17598 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[2].shape;
17599 if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 2;
17600 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17601 if (__pyx_t_20 < 0) {
17602 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[3].shape;
17603 if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 3;
17604 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17605 if (unlikely(__pyx_t_12 != -1)) {
17606 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17607 __PYX_ERR(0, 833, __pyx_L1_error)
17609 __pyx_t_21 = __pyx_v_eN;
17610 __pyx_t_22 = __pyx_v_ebN;
17611 __pyx_t_23 = __pyx_v_k;
17614 if (__pyx_t_21 < 0) {
17615 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
17616 if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0;
17617 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17618 if (__pyx_t_22 < 0) {
17619 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
17620 if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 1;
17621 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17622 if (__pyx_t_23 < 0) {
17623 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
17624 if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 2;
17625 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17626 if (__pyx_t_24 < 0) {
17627 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[3].shape;
17628 if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 3;
17629 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17630 if (unlikely(__pyx_t_12 != -1)) {
17631 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17632 __PYX_ERR(0, 833, __pyx_L1_error)
17634 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[3].strides))));
17643 __pyx_t_25 = __pyx_v_eN;
17644 __pyx_t_26 = __pyx_v_ebN;
17645 __pyx_t_27 = __pyx_v_k;
17648 if (__pyx_t_25 < 0) {
17649 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[0].shape;
17650 if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0;
17651 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17652 if (__pyx_t_26 < 0) {
17653 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[1].shape;
17654 if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 1;
17655 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17656 if (__pyx_t_27 < 0) {
17657 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[2].shape;
17658 if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 2;
17659 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17660 if (__pyx_t_28 < 0) {
17661 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[3].shape;
17662 if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 3;
17663 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17664 if (unlikely(__pyx_t_12 != -1)) {
17665 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17666 __PYX_ERR(0, 834, __pyx_L1_error)
17668 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
17677 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 835, __pyx_L1_error)
17678 __Pyx_GOTREF(__pyx_t_29);
17679 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 835, __pyx_L1_error)
17680 __Pyx_GOTREF(__pyx_t_30);
17681 __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 835, __pyx_L1_error)
17682 __Pyx_GOTREF(__pyx_t_31);
17683 __pyx_t_32 = PyTuple_New(4);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 835, __pyx_L1_error)
17684 __Pyx_GOTREF(__pyx_t_32);
17685 __Pyx_GIVEREF(__pyx_t_29);
17686 PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_29);
17687 __Pyx_GIVEREF(__pyx_t_30);
17688 PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_30);
17689 __Pyx_GIVEREF(__pyx_t_31);
17690 PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_t_31);
17691 __Pyx_INCREF(__pyx_slice__5);
17692 __Pyx_GIVEREF(__pyx_slice__5);
17693 PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_slice__5);
17697 __pyx_t_31 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_32);
if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 835, __pyx_L1_error)
17698 __Pyx_GOTREF(__pyx_t_31);
17699 __pyx_t_33 = (__pyx_v_tForReversal - __pyx_v_t);
17700 __pyx_t_34 = (__pyx_v_tForReversal - 0.0);
17701 if (unlikely(__pyx_t_34 == 0)) {
17702 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17703 __PYX_ERR(0, 835, __pyx_L1_error)
17705 __pyx_t_30 = PyFloat_FromDouble(((__pyx_t_33 / __pyx_t_34) * __pyx_v_clock));
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 835, __pyx_L1_error)
17706 __Pyx_GOTREF(__pyx_t_30);
17707 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_31, __pyx_t_30);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 835, __pyx_L1_error)
17708 __Pyx_GOTREF(__pyx_t_29);
17709 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
17710 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
17711 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_32, __pyx_t_29) < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
17712 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17713 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
17736 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17737 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17738 __pyx_v_eN = __pyx_t_3;
17747 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17748 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17749 __pyx_v_ebN = __pyx_t_5;
17758 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17759 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17760 __pyx_v_k = __pyx_t_7;
17769 __pyx_t_35 = __pyx_v_eN;
17770 __pyx_t_36 = __pyx_v_ebN;
17771 __pyx_t_37 = __pyx_v_k;
17774 if (__pyx_t_35 < 0) {
17775 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
17776 if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0;
17777 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17778 if (__pyx_t_36 < 0) {
17779 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
17780 if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 1;
17781 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17782 if (__pyx_t_37 < 0) {
17783 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
17784 if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 2;
17785 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17786 if (__pyx_t_38 < 0) {
17787 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
17788 if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 3;
17789 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17790 if (unlikely(__pyx_t_12 != -1)) {
17791 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17792 __PYX_ERR(0, 840, __pyx_L1_error)
17794 __pyx_t_39 = __pyx_v_eN;
17795 __pyx_t_40 = __pyx_v_ebN;
17796 __pyx_t_41 = __pyx_v_k;
17799 if (__pyx_t_39 < 0) {
17800 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
17801 if (unlikely(__pyx_t_39 < 0)) __pyx_t_12 = 0;
17802 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17803 if (__pyx_t_40 < 0) {
17804 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
17805 if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 1;
17806 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17807 if (__pyx_t_41 < 0) {
17808 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
17809 if (unlikely(__pyx_t_41 < 0)) __pyx_t_12 = 2;
17810 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17811 if (__pyx_t_42 < 0) {
17812 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
17813 if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 3;
17814 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17815 if (unlikely(__pyx_t_12 != -1)) {
17816 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17817 __PYX_ERR(0, 840, __pyx_L1_error)
17819 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
17828 __pyx_t_43 = __pyx_v_eN;
17829 __pyx_t_44 = __pyx_v_ebN;
17830 __pyx_t_45 = __pyx_v_k;
17833 if (__pyx_t_43 < 0) {
17834 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
17835 if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0;
17836 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17837 if (__pyx_t_44 < 0) {
17838 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
17839 if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 1;
17840 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17841 if (__pyx_t_45 < 0) {
17842 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
17843 if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 2;
17844 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17845 if (__pyx_t_46 < 0) {
17846 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[3].shape;
17847 if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 3;
17848 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17849 if (unlikely(__pyx_t_12 != -1)) {
17850 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17851 __PYX_ERR(0, 841, __pyx_L1_error)
17853 __pyx_t_47 = __pyx_v_eN;
17854 __pyx_t_48 = __pyx_v_ebN;
17855 __pyx_t_49 = __pyx_v_k;
17858 if (__pyx_t_47 < 0) {
17859 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[0].shape;
17860 if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0;
17861 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17862 if (__pyx_t_48 < 0) {
17863 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[1].shape;
17864 if (unlikely(__pyx_t_48 < 0)) __pyx_t_12 = 1;
17865 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17866 if (__pyx_t_49 < 0) {
17867 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[2].shape;
17868 if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 2;
17869 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17870 if (__pyx_t_50 < 0) {
17871 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[3].shape;
17872 if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 3;
17873 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17874 if (unlikely(__pyx_t_12 != -1)) {
17875 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17876 __PYX_ERR(0, 841, __pyx_L1_error)
17878 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[3].strides))));
17887 __pyx_t_51 = __pyx_v_eN;
17888 __pyx_t_52 = __pyx_v_ebN;
17889 __pyx_t_53 = __pyx_v_k;
17892 if (__pyx_t_51 < 0) {
17893 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[0].shape;
17894 if (unlikely(__pyx_t_51 < 0)) __pyx_t_12 = 0;
17895 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17896 if (__pyx_t_52 < 0) {
17897 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[1].shape;
17898 if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 1;
17899 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17900 if (__pyx_t_53 < 0) {
17901 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[2].shape;
17902 if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 2;
17903 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17904 if (__pyx_t_54 < 0) {
17905 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[3].shape;
17906 if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 3;
17907 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17908 if (unlikely(__pyx_t_12 != -1)) {
17909 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17910 __PYX_ERR(0, 842, __pyx_L1_error)
17912 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
17937 #ifndef CYTHON_WITHOUT_ASSERTIONS 17938 if (unlikely(!Py_OptimizeFlag)) {
17939 if (unlikely(!(((__pyx_v_v->dimensions[-1L]) == 2) != 0))) {
17940 PyErr_SetNone(PyExc_AssertionError);
17941 __PYX_ERR(0, 844, __pyx_L1_error)
17953 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17963 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17964 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17965 __pyx_v_eN = __pyx_t_3;
17974 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17975 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17976 __pyx_v_ebN = __pyx_t_5;
17985 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17986 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17987 __pyx_v_k = __pyx_t_7;
17996 __pyx_t_55 = __pyx_v_eN;
17997 __pyx_t_56 = __pyx_v_ebN;
17998 __pyx_t_57 = __pyx_v_k;
18001 if (__pyx_t_55 < 0) {
18002 __pyx_t_55 += __pyx_pybuffernd_x.diminfo[0].shape;
18003 if (unlikely(__pyx_t_55 < 0)) __pyx_t_12 = 0;
18004 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18005 if (__pyx_t_56 < 0) {
18006 __pyx_t_56 += __pyx_pybuffernd_x.diminfo[1].shape;
18007 if (unlikely(__pyx_t_56 < 0)) __pyx_t_12 = 1;
18008 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18009 if (__pyx_t_57 < 0) {
18010 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[2].shape;
18011 if (unlikely(__pyx_t_57 < 0)) __pyx_t_12 = 2;
18012 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18013 if (__pyx_t_58 < 0) {
18014 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[3].shape;
18015 if (unlikely(__pyx_t_58 < 0)) __pyx_t_12 = 3;
18016 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18017 if (unlikely(__pyx_t_12 != -1)) {
18018 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18019 __PYX_ERR(0, 849, __pyx_L1_error)
18021 __pyx_t_59 = __pyx_v_eN;
18022 __pyx_t_60 = __pyx_v_ebN;
18023 __pyx_t_61 = __pyx_v_k;
18026 if (__pyx_t_59 < 0) {
18027 __pyx_t_59 += __pyx_pybuffernd_v.diminfo[0].shape;
18028 if (unlikely(__pyx_t_59 < 0)) __pyx_t_12 = 0;
18029 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18030 if (__pyx_t_60 < 0) {
18031 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[1].shape;
18032 if (unlikely(__pyx_t_60 < 0)) __pyx_t_12 = 1;
18033 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18034 if (__pyx_t_61 < 0) {
18035 __pyx_t_61 += __pyx_pybuffernd_v.diminfo[2].shape;
18036 if (unlikely(__pyx_t_61 < 0)) __pyx_t_12 = 2;
18037 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18038 if (__pyx_t_62 < 0) {
18039 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[3].shape;
18040 if (unlikely(__pyx_t_62 < 0)) __pyx_t_12 = 3;
18041 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18042 if (unlikely(__pyx_t_12 != -1)) {
18043 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18044 __PYX_ERR(0, 849, __pyx_L1_error)
18046 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_61, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_62, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_58, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18055 __pyx_t_63 = __pyx_v_eN;
18056 __pyx_t_64 = __pyx_v_ebN;
18057 __pyx_t_65 = __pyx_v_k;
18060 if (__pyx_t_63 < 0) {
18061 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[0].shape;
18062 if (unlikely(__pyx_t_63 < 0)) __pyx_t_12 = 0;
18063 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18064 if (__pyx_t_64 < 0) {
18065 __pyx_t_64 += __pyx_pybuffernd_x.diminfo[1].shape;
18066 if (unlikely(__pyx_t_64 < 0)) __pyx_t_12 = 1;
18067 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18068 if (__pyx_t_65 < 0) {
18069 __pyx_t_65 += __pyx_pybuffernd_x.diminfo[2].shape;
18070 if (unlikely(__pyx_t_65 < 0)) __pyx_t_12 = 2;
18071 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18072 if (__pyx_t_66 < 0) {
18073 __pyx_t_66 += __pyx_pybuffernd_x.diminfo[3].shape;
18074 if (unlikely(__pyx_t_66 < 0)) __pyx_t_12 = 3;
18075 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18076 if (unlikely(__pyx_t_12 != -1)) {
18077 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18078 __PYX_ERR(0, 850, __pyx_L1_error)
18080 __pyx_t_67 = __pyx_v_eN;
18081 __pyx_t_68 = __pyx_v_ebN;
18082 __pyx_t_69 = __pyx_v_k;
18085 if (__pyx_t_67 < 0) {
18086 __pyx_t_67 += __pyx_pybuffernd_v.diminfo[0].shape;
18087 if (unlikely(__pyx_t_67 < 0)) __pyx_t_12 = 0;
18088 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18089 if (__pyx_t_68 < 0) {
18090 __pyx_t_68 += __pyx_pybuffernd_v.diminfo[1].shape;
18091 if (unlikely(__pyx_t_68 < 0)) __pyx_t_12 = 1;
18092 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18093 if (__pyx_t_69 < 0) {
18094 __pyx_t_69 += __pyx_pybuffernd_v.diminfo[2].shape;
18095 if (unlikely(__pyx_t_69 < 0)) __pyx_t_12 = 2;
18096 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18097 if (__pyx_t_70 < 0) {
18098 __pyx_t_70 += __pyx_pybuffernd_v.diminfo[3].shape;
18099 if (unlikely(__pyx_t_70 < 0)) __pyx_t_12 = 3;
18100 }
else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18101 if (unlikely(__pyx_t_12 != -1)) {
18102 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18103 __PYX_ERR(0, 850, __pyx_L1_error)
18105 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_70, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_66, __pyx_pybuffernd_x.diminfo[3].strides))));
18114 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18115 __Pyx_GOTREF(__pyx_t_32);
18116 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 851, __pyx_L1_error)
18117 __Pyx_GOTREF(__pyx_t_29);
18118 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 851, __pyx_L1_error)
18119 __Pyx_GOTREF(__pyx_t_30);
18120 __pyx_t_31 = PyTuple_New(4);
if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 851, __pyx_L1_error)
18121 __Pyx_GOTREF(__pyx_t_31);
18122 __Pyx_GIVEREF(__pyx_t_32);
18123 PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_32);
18124 __Pyx_GIVEREF(__pyx_t_29);
18125 PyTuple_SET_ITEM(__pyx_t_31, 1, __pyx_t_29);
18126 __Pyx_GIVEREF(__pyx_t_30);
18127 PyTuple_SET_ITEM(__pyx_t_31, 2, __pyx_t_30);
18128 __Pyx_INCREF(__pyx_slice__6);
18129 __Pyx_GIVEREF(__pyx_slice__6);
18130 PyTuple_SET_ITEM(__pyx_t_31, 3, __pyx_slice__6);
18134 __pyx_t_30 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_31);
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 851, __pyx_L1_error)
18135 __Pyx_GOTREF(__pyx_t_30);
18136 __pyx_t_34 = (__pyx_v_tForReversal - __pyx_v_t);
18137 __pyx_t_33 = (__pyx_v_tForReversal - 0.0);
18138 if (unlikely(__pyx_t_33 == 0)) {
18139 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18140 __PYX_ERR(0, 851, __pyx_L1_error)
18142 __pyx_t_29 = PyFloat_FromDouble(((__pyx_t_34 / __pyx_t_33) * __pyx_v_clock));
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 851, __pyx_L1_error)
18143 __Pyx_GOTREF(__pyx_t_29);
18144 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_30, __pyx_t_29);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 851, __pyx_L1_error)
18145 __Pyx_GOTREF(__pyx_t_32);
18146 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
18147 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
18148 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_31, __pyx_t_32) < 0)) __PYX_ERR(0, 851, __pyx_L1_error)
18149 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18150 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
18173 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18174 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18175 __pyx_v_eN = __pyx_t_3;
18184 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18185 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18186 __pyx_v_ebN = __pyx_t_5;
18195 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
18196 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18197 __pyx_v_k = __pyx_t_7;
18206 __pyx_t_71 = __pyx_v_eN;
18207 __pyx_t_72 = __pyx_v_ebN;
18208 __pyx_t_73 = __pyx_v_k;
18211 if (__pyx_t_71 < 0) {
18212 __pyx_t_71 += __pyx_pybuffernd_x.diminfo[0].shape;
18213 if (unlikely(__pyx_t_71 < 0)) __pyx_t_12 = 0;
18214 }
else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18215 if (__pyx_t_72 < 0) {
18216 __pyx_t_72 += __pyx_pybuffernd_x.diminfo[1].shape;
18217 if (unlikely(__pyx_t_72 < 0)) __pyx_t_12 = 1;
18218 }
else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18219 if (__pyx_t_73 < 0) {
18220 __pyx_t_73 += __pyx_pybuffernd_x.diminfo[2].shape;
18221 if (unlikely(__pyx_t_73 < 0)) __pyx_t_12 = 2;
18222 }
else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18223 if (__pyx_t_74 < 0) {
18224 __pyx_t_74 += __pyx_pybuffernd_x.diminfo[3].shape;
18225 if (unlikely(__pyx_t_74 < 0)) __pyx_t_12 = 3;
18226 }
else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18227 if (unlikely(__pyx_t_12 != -1)) {
18228 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18229 __PYX_ERR(0, 856, __pyx_L1_error)
18231 __pyx_t_75 = __pyx_v_eN;
18232 __pyx_t_76 = __pyx_v_ebN;
18233 __pyx_t_77 = __pyx_v_k;
18236 if (__pyx_t_75 < 0) {
18237 __pyx_t_75 += __pyx_pybuffernd_v.diminfo[0].shape;
18238 if (unlikely(__pyx_t_75 < 0)) __pyx_t_12 = 0;
18239 }
else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18240 if (__pyx_t_76 < 0) {
18241 __pyx_t_76 += __pyx_pybuffernd_v.diminfo[1].shape;
18242 if (unlikely(__pyx_t_76 < 0)) __pyx_t_12 = 1;
18243 }
else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18244 if (__pyx_t_77 < 0) {
18245 __pyx_t_77 += __pyx_pybuffernd_v.diminfo[2].shape;
18246 if (unlikely(__pyx_t_77 < 0)) __pyx_t_12 = 2;
18247 }
else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18248 if (__pyx_t_78 < 0) {
18249 __pyx_t_78 += __pyx_pybuffernd_v.diminfo[3].shape;
18250 if (unlikely(__pyx_t_78 < 0)) __pyx_t_12 = 3;
18251 }
else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18252 if (unlikely(__pyx_t_12 != -1)) {
18253 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18254 __PYX_ERR(0, 856, __pyx_L1_error)
18256 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_77, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_78, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_73, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_74, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18265 __pyx_t_79 = __pyx_v_eN;
18266 __pyx_t_80 = __pyx_v_ebN;
18267 __pyx_t_81 = __pyx_v_k;
18270 if (__pyx_t_79 < 0) {
18271 __pyx_t_79 += __pyx_pybuffernd_x.diminfo[0].shape;
18272 if (unlikely(__pyx_t_79 < 0)) __pyx_t_12 = 0;
18273 }
else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18274 if (__pyx_t_80 < 0) {
18275 __pyx_t_80 += __pyx_pybuffernd_x.diminfo[1].shape;
18276 if (unlikely(__pyx_t_80 < 0)) __pyx_t_12 = 1;
18277 }
else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18278 if (__pyx_t_81 < 0) {
18279 __pyx_t_81 += __pyx_pybuffernd_x.diminfo[2].shape;
18280 if (unlikely(__pyx_t_81 < 0)) __pyx_t_12 = 2;
18281 }
else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18282 if (__pyx_t_82 < 0) {
18283 __pyx_t_82 += __pyx_pybuffernd_x.diminfo[3].shape;
18284 if (unlikely(__pyx_t_82 < 0)) __pyx_t_12 = 3;
18285 }
else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18286 if (unlikely(__pyx_t_12 != -1)) {
18287 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18288 __PYX_ERR(0, 857, __pyx_L1_error)
18290 __pyx_t_83 = __pyx_v_eN;
18291 __pyx_t_84 = __pyx_v_ebN;
18292 __pyx_t_85 = __pyx_v_k;
18295 if (__pyx_t_83 < 0) {
18296 __pyx_t_83 += __pyx_pybuffernd_v.diminfo[0].shape;
18297 if (unlikely(__pyx_t_83 < 0)) __pyx_t_12 = 0;
18298 }
else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18299 if (__pyx_t_84 < 0) {
18300 __pyx_t_84 += __pyx_pybuffernd_v.diminfo[1].shape;
18301 if (unlikely(__pyx_t_84 < 0)) __pyx_t_12 = 1;
18302 }
else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18303 if (__pyx_t_85 < 0) {
18304 __pyx_t_85 += __pyx_pybuffernd_v.diminfo[2].shape;
18305 if (unlikely(__pyx_t_85 < 0)) __pyx_t_12 = 2;
18306 }
else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18307 if (__pyx_t_86 < 0) {
18308 __pyx_t_86 += __pyx_pybuffernd_v.diminfo[3].shape;
18309 if (unlikely(__pyx_t_86 < 0)) __pyx_t_12 = 3;
18310 }
else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18311 if (unlikely(__pyx_t_12 != -1)) {
18312 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18313 __PYX_ERR(0, 857, __pyx_L1_error)
18315 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_84, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_85, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_86, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_81, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_82, __pyx_pybuffernd_x.diminfo[3].strides))));
18333 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18336 __Pyx_XDECREF(__pyx_t_29);
18337 __Pyx_XDECREF(__pyx_t_30);
18338 __Pyx_XDECREF(__pyx_t_31);
18339 __Pyx_XDECREF(__pyx_t_32);
18340 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18341 __Pyx_PyThreadState_declare
18342 __Pyx_PyThreadState_assign
18343 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18344 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18345 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18346 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18347 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18351 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18352 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18354 __Pyx_XGIVEREF(__pyx_r);
18355 __Pyx_RefNannyFinishContext();
18368 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18369 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
18370 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18371 int __pyx_v_transient;
18373 double __pyx_v_tForReversal;
18374 double __pyx_v_clock;
18375 double __pyx_v_zVelocity;
18378 PyArrayObject *__pyx_v_x = 0;
18379 PyArrayObject *__pyx_v_v = 0;
18380 PyObject *__pyx_r = 0;
18381 __Pyx_RefNannyDeclarations
18382 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
18384 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
18385 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
18386 if (unlikely(__pyx_kwds)) {
18387 Py_ssize_t kw_args;
18388 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18389 switch (pos_args) {
18390 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18391 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18392 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18393 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18394 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18395 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18396 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18397 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18398 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18400 default:
goto __pyx_L5_argtuple_error;
18402 kw_args = PyDict_Size(__pyx_kwds);
18403 switch (pos_args) {
18405 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
18406 else goto __pyx_L5_argtuple_error;
18408 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18410 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); __PYX_ERR(0, 859, __pyx_L3_error)
18413 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
18415 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); __PYX_ERR(0, 859, __pyx_L3_error)
18418 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
18420 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); __PYX_ERR(0, 859, __pyx_L3_error)
18423 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
18425 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); __PYX_ERR(0, 859, __pyx_L3_error)
18428 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
18430 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); __PYX_ERR(0, 859, __pyx_L3_error)
18433 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
18435 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); __PYX_ERR(0, 859, __pyx_L3_error)
18438 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18440 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); __PYX_ERR(0, 859, __pyx_L3_error)
18443 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
18445 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); __PYX_ERR(0, 859, __pyx_L3_error)
18448 if (unlikely(kw_args > 0)) {
18449 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) __PYX_ERR(0, 859, __pyx_L3_error)
18451 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
18452 goto __pyx_L5_argtuple_error;
18454 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18455 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18456 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18457 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18458 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18459 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18460 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18461 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18462 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18464 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L3_error)
18465 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 860, __pyx_L3_error)
18466 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L3_error)
18467 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 862, __pyx_L3_error)
18468 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 863, __pyx_L3_error)
18469 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
18470 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L3_error)
18471 __pyx_v_x = ((PyArrayObject *)values[7]);
18472 __pyx_v_v = ((PyArrayObject *)values[8]);
18474 goto __pyx_L4_argument_unpacking_done;
18475 __pyx_L5_argtuple_error:;
18476 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 859, __pyx_L3_error)
18478 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18479 __Pyx_RefNannyFinishContext();
18481 __pyx_L4_argument_unpacking_done:;
18482 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 865, __pyx_L1_error)
18483 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 866, __pyx_L1_error)
18484 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
18491 __Pyx_RefNannyFinishContext();
18495 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
18499 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
18500 __Pyx_Buffer __pyx_pybuffer_v;
18501 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
18502 __Pyx_Buffer __pyx_pybuffer_x;
18503 PyObject *__pyx_r = NULL;
18504 __Pyx_RefNannyDeclarations
18506 npy_intp __pyx_t_2;
18508 npy_intp __pyx_t_4;
18510 Py_ssize_t __pyx_t_6;
18511 Py_ssize_t __pyx_t_7;
18512 Py_ssize_t __pyx_t_8;
18514 Py_ssize_t __pyx_t_10;
18515 Py_ssize_t __pyx_t_11;
18516 Py_ssize_t __pyx_t_12;
18517 Py_ssize_t __pyx_t_13;
18518 Py_ssize_t __pyx_t_14;
18519 Py_ssize_t __pyx_t_15;
18520 Py_ssize_t __pyx_t_16;
18521 Py_ssize_t __pyx_t_17;
18522 Py_ssize_t __pyx_t_18;
18523 Py_ssize_t __pyx_t_19;
18524 Py_ssize_t __pyx_t_20;
18525 Py_ssize_t __pyx_t_21;
18526 PyObject *__pyx_t_22 = NULL;
18527 PyObject *__pyx_t_23 = NULL;
18528 PyObject *__pyx_t_24 = NULL;
18531 PyObject *__pyx_t_27 = NULL;
18532 Py_ssize_t __pyx_t_28;
18533 Py_ssize_t __pyx_t_29;
18534 Py_ssize_t __pyx_t_30;
18535 Py_ssize_t __pyx_t_31;
18536 Py_ssize_t __pyx_t_32;
18537 Py_ssize_t __pyx_t_33;
18538 Py_ssize_t __pyx_t_34;
18539 Py_ssize_t __pyx_t_35;
18540 Py_ssize_t __pyx_t_36;
18541 Py_ssize_t __pyx_t_37;
18542 Py_ssize_t __pyx_t_38;
18543 Py_ssize_t __pyx_t_39;
18544 Py_ssize_t __pyx_t_40;
18545 Py_ssize_t __pyx_t_41;
18546 Py_ssize_t __pyx_t_42;
18547 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
18548 __pyx_pybuffer_x.pybuffer.buf = NULL;
18549 __pyx_pybuffer_x.refcount = 0;
18550 __pyx_pybuffernd_x.data = NULL;
18551 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
18552 __pyx_pybuffer_v.pybuffer.buf = NULL;
18553 __pyx_pybuffer_v.refcount = 0;
18554 __pyx_pybuffernd_v.data = NULL;
18555 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
18557 __Pyx_BufFmt_StackElem __pyx_stack[1];
18558 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
18560 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
18562 __Pyx_BufFmt_StackElem __pyx_stack[1];
18563 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 859, __pyx_L1_error)
18565 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
18583 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18593 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18594 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18595 __pyx_v_eN = __pyx_t_3;
18604 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18605 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18606 __pyx_v_k = __pyx_t_5;
18615 __pyx_t_6 = __pyx_v_eN;
18616 __pyx_t_7 = __pyx_v_k;
18619 if (__pyx_t_6 < 0) {
18620 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[0].shape;
18621 if (unlikely(__pyx_t_6 < 0)) __pyx_t_9 = 0;
18622 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18623 if (__pyx_t_7 < 0) {
18624 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[1].shape;
18625 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
18626 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18627 if (__pyx_t_8 < 0) {
18628 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
18629 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
18630 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18631 if (unlikely(__pyx_t_9 != -1)) {
18632 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18633 __PYX_ERR(0, 873, __pyx_L1_error)
18635 __pyx_t_10 = __pyx_v_eN;
18636 __pyx_t_11 = __pyx_v_k;
18639 if (__pyx_t_10 < 0) {
18640 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
18641 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
18642 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18643 if (__pyx_t_11 < 0) {
18644 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[1].shape;
18645 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
18646 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18647 if (__pyx_t_12 < 0) {
18648 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
18649 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 2;
18650 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18651 if (unlikely(__pyx_t_9 != -1)) {
18652 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18653 __PYX_ERR(0, 873, __pyx_L1_error)
18655 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
18664 __pyx_t_13 = __pyx_v_eN;
18665 __pyx_t_14 = __pyx_v_k;
18668 if (__pyx_t_13 < 0) {
18669 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
18670 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
18671 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18672 if (__pyx_t_14 < 0) {
18673 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[1].shape;
18674 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
18675 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18676 if (__pyx_t_15 < 0) {
18677 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[2].shape;
18678 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 2;
18679 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18680 if (unlikely(__pyx_t_9 != -1)) {
18681 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18682 __PYX_ERR(0, 874, __pyx_L1_error)
18684 __pyx_t_16 = __pyx_v_eN;
18685 __pyx_t_17 = __pyx_v_k;
18688 if (__pyx_t_16 < 0) {
18689 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
18690 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
18691 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18692 if (__pyx_t_17 < 0) {
18693 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
18694 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
18695 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18696 if (__pyx_t_18 < 0) {
18697 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
18698 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
18699 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18700 if (unlikely(__pyx_t_9 != -1)) {
18701 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18702 __PYX_ERR(0, 874, __pyx_L1_error)
18704 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[2].strides))));
18713 __pyx_t_19 = __pyx_v_eN;
18714 __pyx_t_20 = __pyx_v_k;
18717 if (__pyx_t_19 < 0) {
18718 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
18719 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
18720 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18721 if (__pyx_t_20 < 0) {
18722 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[1].shape;
18723 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
18724 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18725 if (__pyx_t_21 < 0) {
18726 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[2].shape;
18727 if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 2;
18728 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18729 if (unlikely(__pyx_t_9 != -1)) {
18730 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18731 __PYX_ERR(0, 875, __pyx_L1_error)
18733 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
18742 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 876, __pyx_L1_error)
18743 __Pyx_GOTREF(__pyx_t_22);
18744 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 876, __pyx_L1_error)
18745 __Pyx_GOTREF(__pyx_t_23);
18746 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 876, __pyx_L1_error)
18747 __Pyx_GOTREF(__pyx_t_24);
18748 __Pyx_GIVEREF(__pyx_t_22);
18749 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22);
18750 __Pyx_GIVEREF(__pyx_t_23);
18751 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
18752 __Pyx_INCREF(__pyx_slice__7);
18753 __Pyx_GIVEREF(__pyx_slice__7);
18754 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice__7);
18757 __pyx_t_23 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 876, __pyx_L1_error)
18758 __Pyx_GOTREF(__pyx_t_23);
18759 __pyx_t_25 = (__pyx_v_pi * __pyx_v_t);
18760 __pyx_t_26 = (__pyx_v_tForReversal * 2.0);
18761 if (unlikely(__pyx_t_26 == 0)) {
18762 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18763 __PYX_ERR(0, 876, __pyx_L1_error)
18765 __pyx_t_22 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_25 / __pyx_t_26))));
if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 876, __pyx_L1_error)
18766 __Pyx_GOTREF(__pyx_t_22);
18767 __pyx_t_27 = PyNumber_InPlaceMultiply(__pyx_t_23, __pyx_t_22);
if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 876, __pyx_L1_error)
18768 __Pyx_GOTREF(__pyx_t_27);
18769 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18770 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18771 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_27) < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
18772 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
18773 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
18795 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18796 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18797 __pyx_v_eN = __pyx_t_3;
18806 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18807 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18808 __pyx_v_k = __pyx_t_5;
18817 __pyx_t_28 = __pyx_v_eN;
18818 __pyx_t_29 = __pyx_v_k;
18821 if (__pyx_t_28 < 0) {
18822 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
18823 if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
18824 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18825 if (__pyx_t_29 < 0) {
18826 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
18827 if (unlikely(__pyx_t_29 < 0)) __pyx_t_9 = 1;
18828 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18829 if (__pyx_t_30 < 0) {
18830 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
18831 if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 2;
18832 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18833 if (unlikely(__pyx_t_9 != -1)) {
18834 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18835 __PYX_ERR(0, 880, __pyx_L1_error)
18837 __pyx_t_31 = __pyx_v_eN;
18838 __pyx_t_32 = __pyx_v_k;
18841 if (__pyx_t_31 < 0) {
18842 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[0].shape;
18843 if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
18844 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18845 if (__pyx_t_32 < 0) {
18846 __pyx_t_32 += __pyx_pybuffernd_v.diminfo[1].shape;
18847 if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 1;
18848 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18849 if (__pyx_t_33 < 0) {
18850 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[2].shape;
18851 if (unlikely(__pyx_t_33 < 0)) __pyx_t_9 = 2;
18852 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18853 if (unlikely(__pyx_t_9 != -1)) {
18854 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18855 __PYX_ERR(0, 880, __pyx_L1_error)
18857 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
18866 __pyx_t_34 = __pyx_v_eN;
18867 __pyx_t_35 = __pyx_v_k;
18870 if (__pyx_t_34 < 0) {
18871 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[0].shape;
18872 if (unlikely(__pyx_t_34 < 0)) __pyx_t_9 = 0;
18873 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18874 if (__pyx_t_35 < 0) {
18875 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[1].shape;
18876 if (unlikely(__pyx_t_35 < 0)) __pyx_t_9 = 1;
18877 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18878 if (__pyx_t_36 < 0) {
18879 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[2].shape;
18880 if (unlikely(__pyx_t_36 < 0)) __pyx_t_9 = 2;
18881 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18882 if (unlikely(__pyx_t_9 != -1)) {
18883 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18884 __PYX_ERR(0, 881, __pyx_L1_error)
18886 __pyx_t_37 = __pyx_v_eN;
18887 __pyx_t_38 = __pyx_v_k;
18890 if (__pyx_t_37 < 0) {
18891 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[0].shape;
18892 if (unlikely(__pyx_t_37 < 0)) __pyx_t_9 = 0;
18893 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18894 if (__pyx_t_38 < 0) {
18895 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[1].shape;
18896 if (unlikely(__pyx_t_38 < 0)) __pyx_t_9 = 1;
18897 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18898 if (__pyx_t_39 < 0) {
18899 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[2].shape;
18900 if (unlikely(__pyx_t_39 < 0)) __pyx_t_9 = 2;
18901 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18902 if (unlikely(__pyx_t_9 != -1)) {
18903 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18904 __PYX_ERR(0, 881, __pyx_L1_error)
18906 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[2].strides))));
18915 __pyx_t_40 = __pyx_v_eN;
18916 __pyx_t_41 = __pyx_v_k;
18919 if (__pyx_t_40 < 0) {
18920 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[0].shape;
18921 if (unlikely(__pyx_t_40 < 0)) __pyx_t_9 = 0;
18922 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18923 if (__pyx_t_41 < 0) {
18924 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[1].shape;
18925 if (unlikely(__pyx_t_41 < 0)) __pyx_t_9 = 1;
18926 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18927 if (__pyx_t_42 < 0) {
18928 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[2].shape;
18929 if (unlikely(__pyx_t_42 < 0)) __pyx_t_9 = 2;
18930 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18931 if (unlikely(__pyx_t_9 != -1)) {
18932 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18933 __PYX_ERR(0, 882, __pyx_L1_error)
18935 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
18950 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18953 __Pyx_XDECREF(__pyx_t_22);
18954 __Pyx_XDECREF(__pyx_t_23);
18955 __Pyx_XDECREF(__pyx_t_24);
18956 __Pyx_XDECREF(__pyx_t_27);
18957 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18958 __Pyx_PyThreadState_declare
18959 __Pyx_PyThreadState_assign
18960 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18961 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18962 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18963 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18964 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18968 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18969 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18971 __Pyx_XGIVEREF(__pyx_r);
18972 __Pyx_RefNannyFinishContext();
18985 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18986 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
18987 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18988 int __pyx_v_transient;
18990 double __pyx_v_tForReversal;
18991 double __pyx_v_clock;
18992 double __pyx_v_zVelocity;
18995 PyArrayObject *__pyx_v_x = 0;
18996 PyArrayObject *__pyx_v_v = 0;
18997 PyObject *__pyx_r = 0;
18998 __Pyx_RefNannyDeclarations
18999 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
19001 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
19002 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19003 if (unlikely(__pyx_kwds)) {
19004 Py_ssize_t kw_args;
19005 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19006 switch (pos_args) {
19007 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19008 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19009 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19010 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19011 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19012 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19013 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19014 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19015 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19017 default:
goto __pyx_L5_argtuple_error;
19019 kw_args = PyDict_Size(__pyx_kwds);
19020 switch (pos_args) {
19022 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
19023 else goto __pyx_L5_argtuple_error;
19025 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19027 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); __PYX_ERR(0, 884, __pyx_L3_error)
19030 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
19032 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); __PYX_ERR(0, 884, __pyx_L3_error)
19035 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
19037 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); __PYX_ERR(0, 884, __pyx_L3_error)
19040 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
19042 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); __PYX_ERR(0, 884, __pyx_L3_error)
19045 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
19047 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); __PYX_ERR(0, 884, __pyx_L3_error)
19050 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
19052 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); __PYX_ERR(0, 884, __pyx_L3_error)
19055 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19057 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); __PYX_ERR(0, 884, __pyx_L3_error)
19060 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19062 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); __PYX_ERR(0, 884, __pyx_L3_error)
19065 if (unlikely(kw_args > 0)) {
19066 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
19068 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
19069 goto __pyx_L5_argtuple_error;
19071 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19072 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19073 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19074 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19075 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19076 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19077 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19078 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19079 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19081 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 884, __pyx_L3_error)
19082 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L3_error)
19083 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error)
19084 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L3_error)
19085 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L3_error)
19086 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19087 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error)
19088 __pyx_v_x = ((PyArrayObject *)values[7]);
19089 __pyx_v_v = ((PyArrayObject *)values[8]);
19091 goto __pyx_L4_argument_unpacking_done;
19092 __pyx_L5_argtuple_error:;
19093 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
19095 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19096 __Pyx_RefNannyFinishContext();
19098 __pyx_L4_argument_unpacking_done:;
19099 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 890, __pyx_L1_error)
19100 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 891, __pyx_L1_error)
19101 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
19108 __Pyx_RefNannyFinishContext();
19112 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19117 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19118 __Pyx_Buffer __pyx_pybuffer_v;
19119 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19120 __Pyx_Buffer __pyx_pybuffer_x;
19121 PyObject *__pyx_r = NULL;
19122 __Pyx_RefNannyDeclarations
19124 npy_intp __pyx_t_2;
19126 npy_intp __pyx_t_4;
19128 npy_intp __pyx_t_6;
19130 Py_ssize_t __pyx_t_8;
19131 Py_ssize_t __pyx_t_9;
19132 Py_ssize_t __pyx_t_10;
19133 Py_ssize_t __pyx_t_11;
19135 Py_ssize_t __pyx_t_13;
19136 Py_ssize_t __pyx_t_14;
19137 Py_ssize_t __pyx_t_15;
19138 Py_ssize_t __pyx_t_16;
19139 Py_ssize_t __pyx_t_17;
19140 Py_ssize_t __pyx_t_18;
19141 Py_ssize_t __pyx_t_19;
19142 Py_ssize_t __pyx_t_20;
19143 Py_ssize_t __pyx_t_21;
19144 Py_ssize_t __pyx_t_22;
19145 Py_ssize_t __pyx_t_23;
19146 Py_ssize_t __pyx_t_24;
19147 Py_ssize_t __pyx_t_25;
19148 Py_ssize_t __pyx_t_26;
19149 Py_ssize_t __pyx_t_27;
19150 Py_ssize_t __pyx_t_28;
19151 PyObject *__pyx_t_29 = NULL;
19152 PyObject *__pyx_t_30 = NULL;
19153 PyObject *__pyx_t_31 = NULL;
19154 PyObject *__pyx_t_32 = NULL;
19157 Py_ssize_t __pyx_t_35;
19158 Py_ssize_t __pyx_t_36;
19159 Py_ssize_t __pyx_t_37;
19160 Py_ssize_t __pyx_t_38;
19161 Py_ssize_t __pyx_t_39;
19162 Py_ssize_t __pyx_t_40;
19163 Py_ssize_t __pyx_t_41;
19164 Py_ssize_t __pyx_t_42;
19165 Py_ssize_t __pyx_t_43;
19166 Py_ssize_t __pyx_t_44;
19167 Py_ssize_t __pyx_t_45;
19168 Py_ssize_t __pyx_t_46;
19169 Py_ssize_t __pyx_t_47;
19170 Py_ssize_t __pyx_t_48;
19171 Py_ssize_t __pyx_t_49;
19172 Py_ssize_t __pyx_t_50;
19173 Py_ssize_t __pyx_t_51;
19174 Py_ssize_t __pyx_t_52;
19175 Py_ssize_t __pyx_t_53;
19176 Py_ssize_t __pyx_t_54;
19177 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
19178 __pyx_pybuffer_x.pybuffer.buf = NULL;
19179 __pyx_pybuffer_x.refcount = 0;
19180 __pyx_pybuffernd_x.data = NULL;
19181 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19182 __pyx_pybuffer_v.pybuffer.buf = NULL;
19183 __pyx_pybuffer_v.refcount = 0;
19184 __pyx_pybuffernd_v.data = NULL;
19185 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19187 __Pyx_BufFmt_StackElem __pyx_stack[1];
19188 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19190 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19192 __Pyx_BufFmt_StackElem __pyx_stack[1];
19193 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 884, __pyx_L1_error)
19195 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19213 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
19223 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19224 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19225 __pyx_v_eN = __pyx_t_3;
19234 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
19235 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
19236 __pyx_v_ebN = __pyx_t_5;
19245 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
19246 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19247 __pyx_v_k = __pyx_t_7;
19256 __pyx_t_8 = __pyx_v_eN;
19257 __pyx_t_9 = __pyx_v_ebN;
19258 __pyx_t_10 = __pyx_v_k;
19261 if (__pyx_t_8 < 0) {
19262 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
19263 if (unlikely(__pyx_t_8 < 0)) __pyx_t_12 = 0;
19264 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
19265 if (__pyx_t_9 < 0) {
19266 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
19267 if (unlikely(__pyx_t_9 < 0)) __pyx_t_12 = 1;
19268 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
19269 if (__pyx_t_10 < 0) {
19270 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
19271 if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 2;
19272 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
19273 if (__pyx_t_11 < 0) {
19274 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
19275 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 3;
19276 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
19277 if (unlikely(__pyx_t_12 != -1)) {
19278 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19279 __PYX_ERR(0, 899, __pyx_L1_error)
19281 __pyx_t_13 = __pyx_v_eN;
19282 __pyx_t_14 = __pyx_v_ebN;
19283 __pyx_t_15 = __pyx_v_k;
19286 if (__pyx_t_13 < 0) {
19287 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
19288 if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
19289 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19290 if (__pyx_t_14 < 0) {
19291 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
19292 if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 1;
19293 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19294 if (__pyx_t_15 < 0) {
19295 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
19296 if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 2;
19297 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19298 if (__pyx_t_16 < 0) {
19299 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
19300 if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 3;
19301 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19302 if (unlikely(__pyx_t_12 != -1)) {
19303 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19304 __PYX_ERR(0, 899, __pyx_L1_error)
19306 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
19315 __pyx_t_17 = __pyx_v_eN;
19316 __pyx_t_18 = __pyx_v_ebN;
19317 __pyx_t_19 = __pyx_v_k;
19320 if (__pyx_t_17 < 0) {
19321 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape;
19322 if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0;
19323 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
19324 if (__pyx_t_18 < 0) {
19325 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[1].shape;
19326 if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 1;
19327 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
19328 if (__pyx_t_19 < 0) {
19329 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[2].shape;
19330 if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 2;
19331 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
19332 if (__pyx_t_20 < 0) {
19333 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[3].shape;
19334 if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 3;
19335 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
19336 if (unlikely(__pyx_t_12 != -1)) {
19337 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19338 __PYX_ERR(0, 900, __pyx_L1_error)
19340 __pyx_t_21 = __pyx_v_eN;
19341 __pyx_t_22 = __pyx_v_ebN;
19342 __pyx_t_23 = __pyx_v_k;
19345 if (__pyx_t_21 < 0) {
19346 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
19347 if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0;
19348 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19349 if (__pyx_t_22 < 0) {
19350 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
19351 if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 1;
19352 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19353 if (__pyx_t_23 < 0) {
19354 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
19355 if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 2;
19356 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19357 if (__pyx_t_24 < 0) {
19358 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[3].shape;
19359 if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 3;
19360 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19361 if (unlikely(__pyx_t_12 != -1)) {
19362 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19363 __PYX_ERR(0, 900, __pyx_L1_error)
19365 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[3].strides))));
19374 __pyx_t_25 = __pyx_v_eN;
19375 __pyx_t_26 = __pyx_v_ebN;
19376 __pyx_t_27 = __pyx_v_k;
19379 if (__pyx_t_25 < 0) {
19380 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[0].shape;
19381 if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0;
19382 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19383 if (__pyx_t_26 < 0) {
19384 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[1].shape;
19385 if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 1;
19386 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19387 if (__pyx_t_27 < 0) {
19388 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[2].shape;
19389 if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 2;
19390 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19391 if (__pyx_t_28 < 0) {
19392 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[3].shape;
19393 if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 3;
19394 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19395 if (unlikely(__pyx_t_12 != -1)) {
19396 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19397 __PYX_ERR(0, 901, __pyx_L1_error)
19399 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
19408 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 902, __pyx_L1_error)
19409 __Pyx_GOTREF(__pyx_t_29);
19410 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 902, __pyx_L1_error)
19411 __Pyx_GOTREF(__pyx_t_30);
19412 __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 902, __pyx_L1_error)
19413 __Pyx_GOTREF(__pyx_t_31);
19414 __pyx_t_32 = PyTuple_New(4);
if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 902, __pyx_L1_error)
19415 __Pyx_GOTREF(__pyx_t_32);
19416 __Pyx_GIVEREF(__pyx_t_29);
19417 PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_29);
19418 __Pyx_GIVEREF(__pyx_t_30);
19419 PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_30);
19420 __Pyx_GIVEREF(__pyx_t_31);
19421 PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_t_31);
19422 __Pyx_INCREF(__pyx_slice__8);
19423 __Pyx_GIVEREF(__pyx_slice__8);
19424 PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_slice__8);
19428 __pyx_t_31 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_32);
if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 902, __pyx_L1_error)
19429 __Pyx_GOTREF(__pyx_t_31);
19430 __pyx_t_33 = (__pyx_v_pi * __pyx_v_t);
19431 __pyx_t_34 = (__pyx_v_tForReversal * 2.0);
19432 if (unlikely(__pyx_t_34 == 0)) {
19433 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
19434 __PYX_ERR(0, 902, __pyx_L1_error)
19436 __pyx_t_30 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_33 / __pyx_t_34))));
if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 902, __pyx_L1_error)
19437 __Pyx_GOTREF(__pyx_t_30);
19438 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_31, __pyx_t_30);
if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 902, __pyx_L1_error)
19439 __Pyx_GOTREF(__pyx_t_29);
19440 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
19441 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
19442 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_32, __pyx_t_29) < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
19443 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
19444 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
19467 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
19468 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19469 __pyx_v_eN = __pyx_t_3;
19478 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
19479 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
19480 __pyx_v_ebN = __pyx_t_5;
19489 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
19490 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
19491 __pyx_v_k = __pyx_t_7;
19500 __pyx_t_35 = __pyx_v_eN;
19501 __pyx_t_36 = __pyx_v_ebN;
19502 __pyx_t_37 = __pyx_v_k;
19505 if (__pyx_t_35 < 0) {
19506 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
19507 if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0;
19508 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
19509 if (__pyx_t_36 < 0) {
19510 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
19511 if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 1;
19512 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
19513 if (__pyx_t_37 < 0) {
19514 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
19515 if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 2;
19516 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
19517 if (__pyx_t_38 < 0) {
19518 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
19519 if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 3;
19520 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
19521 if (unlikely(__pyx_t_12 != -1)) {
19522 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19523 __PYX_ERR(0, 907, __pyx_L1_error)
19525 __pyx_t_39 = __pyx_v_eN;
19526 __pyx_t_40 = __pyx_v_ebN;
19527 __pyx_t_41 = __pyx_v_k;
19530 if (__pyx_t_39 < 0) {
19531 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
19532 if (unlikely(__pyx_t_39 < 0)) __pyx_t_12 = 0;
19533 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19534 if (__pyx_t_40 < 0) {
19535 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
19536 if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 1;
19537 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19538 if (__pyx_t_41 < 0) {
19539 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
19540 if (unlikely(__pyx_t_41 < 0)) __pyx_t_12 = 2;
19541 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19542 if (__pyx_t_42 < 0) {
19543 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
19544 if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 3;
19545 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19546 if (unlikely(__pyx_t_12 != -1)) {
19547 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19548 __PYX_ERR(0, 907, __pyx_L1_error)
19550 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
19559 __pyx_t_43 = __pyx_v_eN;
19560 __pyx_t_44 = __pyx_v_ebN;
19561 __pyx_t_45 = __pyx_v_k;
19564 if (__pyx_t_43 < 0) {
19565 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
19566 if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0;
19567 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
19568 if (__pyx_t_44 < 0) {
19569 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
19570 if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 1;
19571 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
19572 if (__pyx_t_45 < 0) {
19573 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
19574 if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 2;
19575 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
19576 if (__pyx_t_46 < 0) {
19577 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[3].shape;
19578 if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 3;
19579 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
19580 if (unlikely(__pyx_t_12 != -1)) {
19581 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19582 __PYX_ERR(0, 908, __pyx_L1_error)
19584 __pyx_t_47 = __pyx_v_eN;
19585 __pyx_t_48 = __pyx_v_ebN;
19586 __pyx_t_49 = __pyx_v_k;
19589 if (__pyx_t_47 < 0) {
19590 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[0].shape;
19591 if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0;
19592 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19593 if (__pyx_t_48 < 0) {
19594 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[1].shape;
19595 if (unlikely(__pyx_t_48 < 0)) __pyx_t_12 = 1;
19596 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19597 if (__pyx_t_49 < 0) {
19598 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[2].shape;
19599 if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 2;
19600 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19601 if (__pyx_t_50 < 0) {
19602 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[3].shape;
19603 if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 3;
19604 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19605 if (unlikely(__pyx_t_12 != -1)) {
19606 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19607 __PYX_ERR(0, 908, __pyx_L1_error)
19609 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[3].strides))));
19618 __pyx_t_51 = __pyx_v_eN;
19619 __pyx_t_52 = __pyx_v_ebN;
19620 __pyx_t_53 = __pyx_v_k;
19623 if (__pyx_t_51 < 0) {
19624 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[0].shape;
19625 if (unlikely(__pyx_t_51 < 0)) __pyx_t_12 = 0;
19626 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
19627 if (__pyx_t_52 < 0) {
19628 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[1].shape;
19629 if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 1;
19630 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
19631 if (__pyx_t_53 < 0) {
19632 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[2].shape;
19633 if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 2;
19634 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
19635 if (__pyx_t_54 < 0) {
19636 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[3].shape;
19637 if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 3;
19638 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
19639 if (unlikely(__pyx_t_12 != -1)) {
19640 __Pyx_RaiseBufferIndexError(__pyx_t_12);
19641 __PYX_ERR(0, 909, __pyx_L1_error)
19643 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
19659 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19662 __Pyx_XDECREF(__pyx_t_29);
19663 __Pyx_XDECREF(__pyx_t_30);
19664 __Pyx_XDECREF(__pyx_t_31);
19665 __Pyx_XDECREF(__pyx_t_32);
19666 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19667 __Pyx_PyThreadState_declare
19668 __Pyx_PyThreadState_assign
19669 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19670 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19671 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19672 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19673 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19677 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19678 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19680 __Pyx_XGIVEREF(__pyx_r);
19681 __Pyx_RefNannyFinishContext();
19694 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19695 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
19696 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19698 PyArrayObject *__pyx_v_x = 0;
19699 PyArrayObject *__pyx_v_v = 0;
19700 PyObject *__pyx_r = 0;
19701 __Pyx_RefNannyDeclarations
19702 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
19704 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
19705 PyObject* values[3] = {0,0,0};
19706 if (unlikely(__pyx_kwds)) {
19707 Py_ssize_t kw_args;
19708 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19709 switch (pos_args) {
19710 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19711 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19712 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19714 default:
goto __pyx_L5_argtuple_error;
19716 kw_args = PyDict_Size(__pyx_kwds);
19717 switch (pos_args) {
19719 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19720 else goto __pyx_L5_argtuple_error;
19722 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19724 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); __PYX_ERR(0, 911, __pyx_L3_error)
19727 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19729 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); __PYX_ERR(0, 911, __pyx_L3_error)
19732 if (unlikely(kw_args > 0)) {
19733 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) __PYX_ERR(0, 911, __pyx_L3_error)
19735 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19736 goto __pyx_L5_argtuple_error;
19738 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19739 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19740 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19742 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 911, __pyx_L3_error)
19743 __pyx_v_x = ((PyArrayObject *)values[1]);
19744 __pyx_v_v = ((PyArrayObject *)values[2]);
19746 goto __pyx_L4_argument_unpacking_done;
19747 __pyx_L5_argtuple_error:;
19748 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 911, __pyx_L3_error)
19750 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19751 __Pyx_RefNannyFinishContext();
19753 __pyx_L4_argument_unpacking_done:;
19754 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
19755 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
19756 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
19763 __Pyx_RefNannyFinishContext();
19767 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19771 double __pyx_v_one8;
19772 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19773 __Pyx_Buffer __pyx_pybuffer_v;
19774 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19775 __Pyx_Buffer __pyx_pybuffer_x;
19776 PyObject *__pyx_r = NULL;
19777 __Pyx_RefNannyDeclarations
19778 npy_intp __pyx_t_1;
19780 npy_intp __pyx_t_3;
19782 Py_ssize_t __pyx_t_5;
19783 Py_ssize_t __pyx_t_6;
19784 Py_ssize_t __pyx_t_7;
19786 Py_ssize_t __pyx_t_9;
19787 Py_ssize_t __pyx_t_10;
19788 Py_ssize_t __pyx_t_11;
19789 Py_ssize_t __pyx_t_12;
19790 Py_ssize_t __pyx_t_13;
19791 Py_ssize_t __pyx_t_14;
19792 Py_ssize_t __pyx_t_15;
19793 Py_ssize_t __pyx_t_16;
19794 Py_ssize_t __pyx_t_17;
19795 Py_ssize_t __pyx_t_18;
19796 Py_ssize_t __pyx_t_19;
19797 Py_ssize_t __pyx_t_20;
19798 Py_ssize_t __pyx_t_21;
19799 Py_ssize_t __pyx_t_22;
19800 Py_ssize_t __pyx_t_23;
19801 Py_ssize_t __pyx_t_24;
19802 Py_ssize_t __pyx_t_25;
19803 Py_ssize_t __pyx_t_26;
19804 Py_ssize_t __pyx_t_27;
19805 Py_ssize_t __pyx_t_28;
19806 Py_ssize_t __pyx_t_29;
19807 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
19808 __pyx_pybuffer_x.pybuffer.buf = NULL;
19809 __pyx_pybuffer_x.refcount = 0;
19810 __pyx_pybuffernd_x.data = NULL;
19811 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19812 __pyx_pybuffer_v.pybuffer.buf = NULL;
19813 __pyx_pybuffer_v.refcount = 0;
19814 __pyx_pybuffernd_v.data = NULL;
19815 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19817 __Pyx_BufFmt_StackElem __pyx_stack[1];
19818 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
19820 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19822 __Pyx_BufFmt_StackElem __pyx_stack[1];
19823 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 911, __pyx_L1_error)
19825 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19843 __pyx_v_one8 = (1.0 / 8.0);
19852 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
19853 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
19854 __pyx_v_eN = __pyx_t_2;
19863 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
19864 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19865 __pyx_v_k = __pyx_t_4;
19874 __pyx_t_5 = __pyx_v_eN;
19875 __pyx_t_6 = __pyx_v_k;
19878 if (__pyx_t_5 < 0) {
19879 __pyx_t_5 += __pyx_pybuffernd_x.diminfo[0].shape;
19880 if (unlikely(__pyx_t_5 < 0)) __pyx_t_8 = 0;
19881 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19882 if (__pyx_t_6 < 0) {
19883 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[1].shape;
19884 if (unlikely(__pyx_t_6 < 0)) __pyx_t_8 = 1;
19885 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19886 if (__pyx_t_7 < 0) {
19887 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
19888 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 2;
19889 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19890 if (unlikely(__pyx_t_8 != -1)) {
19891 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19892 __PYX_ERR(0, 920, __pyx_L1_error)
19894 __pyx_t_9 = __pyx_v_eN;
19895 __pyx_t_10 = __pyx_v_k;
19898 if (__pyx_t_9 < 0) {
19899 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
19900 if (unlikely(__pyx_t_9 < 0)) __pyx_t_8 = 0;
19901 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19902 if (__pyx_t_10 < 0) {
19903 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[1].shape;
19904 if (unlikely(__pyx_t_10 < 0)) __pyx_t_8 = 1;
19905 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19906 if (__pyx_t_11 < 0) {
19907 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
19908 if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 2;
19909 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19910 if (unlikely(__pyx_t_8 != -1)) {
19911 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19912 __PYX_ERR(0, 920, __pyx_L1_error)
19914 __pyx_t_12 = __pyx_v_eN;
19915 __pyx_t_13 = __pyx_v_k;
19918 if (__pyx_t_12 < 0) {
19919 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[0].shape;
19920 if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
19921 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19922 if (__pyx_t_13 < 0) {
19923 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19924 if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 1;
19925 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19926 if (__pyx_t_14 < 0) {
19927 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
19928 if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 2;
19929 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19930 if (unlikely(__pyx_t_8 != -1)) {
19931 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19932 __PYX_ERR(0, 920, __pyx_L1_error)
19934 __pyx_t_15 = __pyx_v_eN;
19935 __pyx_t_16 = __pyx_v_k;
19938 if (__pyx_t_15 < 0) {
19939 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[0].shape;
19940 if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
19941 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_8 = 0;
19942 if (__pyx_t_16 < 0) {
19943 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[1].shape;
19944 if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 1;
19945 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_8 = 1;
19946 if (__pyx_t_17 < 0) {
19947 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
19948 if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 2;
19949 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_8 = 2;
19950 if (unlikely(__pyx_t_8 != -1)) {
19951 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19952 __PYX_ERR(0, 920, __pyx_L1_error)
19954 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides)))));
19963 __pyx_t_18 = __pyx_v_eN;
19964 __pyx_t_19 = __pyx_v_k;
19967 if (__pyx_t_18 < 0) {
19968 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
19969 if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
19970 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19971 if (__pyx_t_19 < 0) {
19972 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[1].shape;
19973 if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 1;
19974 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19975 if (__pyx_t_20 < 0) {
19976 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
19977 if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 2;
19978 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19979 if (unlikely(__pyx_t_8 != -1)) {
19980 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19981 __PYX_ERR(0, 921, __pyx_L1_error)
19983 __pyx_t_21 = __pyx_v_eN;
19984 __pyx_t_22 = __pyx_v_k;
19987 if (__pyx_t_21 < 0) {
19988 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[0].shape;
19989 if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
19990 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19991 if (__pyx_t_22 < 0) {
19992 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[1].shape;
19993 if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 1;
19994 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19995 if (__pyx_t_23 < 0) {
19996 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[2].shape;
19997 if (unlikely(__pyx_t_23 < 0)) __pyx_t_8 = 2;
19998 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19999 if (unlikely(__pyx_t_8 != -1)) {
20000 __Pyx_RaiseBufferIndexError(__pyx_t_8);
20001 __PYX_ERR(0, 921, __pyx_L1_error)
20003 __pyx_t_24 = __pyx_v_eN;
20004 __pyx_t_25 = __pyx_v_k;
20007 if (__pyx_t_24 < 0) {
20008 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[0].shape;
20009 if (unlikely(__pyx_t_24 < 0)) __pyx_t_8 = 0;
20010 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
20011 if (__pyx_t_25 < 0) {
20012 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[1].shape;
20013 if (unlikely(__pyx_t_25 < 0)) __pyx_t_8 = 1;
20014 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
20015 if (__pyx_t_26 < 0) {
20016 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[2].shape;
20017 if (unlikely(__pyx_t_26 < 0)) __pyx_t_8 = 2;
20018 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
20019 if (unlikely(__pyx_t_8 != -1)) {
20020 __Pyx_RaiseBufferIndexError(__pyx_t_8);
20021 __PYX_ERR(0, 921, __pyx_L1_error)
20023 __pyx_t_27 = __pyx_v_eN;
20024 __pyx_t_28 = __pyx_v_k;
20027 if (__pyx_t_27 < 0) {
20028 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[0].shape;
20029 if (unlikely(__pyx_t_27 < 0)) __pyx_t_8 = 0;
20030 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_8 = 0;
20031 if (__pyx_t_28 < 0) {
20032 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[1].shape;
20033 if (unlikely(__pyx_t_28 < 0)) __pyx_t_8 = 1;
20034 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_8 = 1;
20035 if (__pyx_t_29 < 0) {
20036 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[2].shape;
20037 if (unlikely(__pyx_t_29 < 0)) __pyx_t_8 = 2;
20038 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_8 = 2;
20039 if (unlikely(__pyx_t_8 != -1)) {
20040 __Pyx_RaiseBufferIndexError(__pyx_t_8);
20041 __PYX_ERR(0, 921, __pyx_L1_error)
20043 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_x.diminfo[2].strides)))));
20056 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20059 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20060 __Pyx_PyThreadState_declare
20061 __Pyx_PyThreadState_assign
20062 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20063 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20064 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20065 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20066 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20070 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20071 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20073 __Pyx_XGIVEREF(__pyx_r);
20074 __Pyx_RefNannyFinishContext();
20087 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20088 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
20089 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20091 PyArrayObject *__pyx_v_x = 0;
20092 PyArrayObject *__pyx_v_v = 0;
20093 PyObject *__pyx_r = 0;
20094 __Pyx_RefNannyDeclarations
20095 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
20097 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
20098 PyObject* values[3] = {0,0,0};
20099 if (unlikely(__pyx_kwds)) {
20100 Py_ssize_t kw_args;
20101 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20102 switch (pos_args) {
20103 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20104 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20105 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20107 default:
goto __pyx_L5_argtuple_error;
20109 kw_args = PyDict_Size(__pyx_kwds);
20110 switch (pos_args) {
20112 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
20113 else goto __pyx_L5_argtuple_error;
20115 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
20117 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); __PYX_ERR(0, 924, __pyx_L3_error)
20120 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
20122 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); __PYX_ERR(0, 924, __pyx_L3_error)
20125 if (unlikely(kw_args > 0)) {
20126 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) __PYX_ERR(0, 924, __pyx_L3_error)
20128 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20129 goto __pyx_L5_argtuple_error;
20131 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20132 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20133 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20135 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L3_error)
20136 __pyx_v_x = ((PyArrayObject *)values[1]);
20137 __pyx_v_v = ((PyArrayObject *)values[2]);
20139 goto __pyx_L4_argument_unpacking_done;
20140 __pyx_L5_argtuple_error:;
20141 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 924, __pyx_L3_error)
20143 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20144 __Pyx_RefNannyFinishContext();
20146 __pyx_L4_argument_unpacking_done:;
20147 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) __PYX_ERR(0, 925, __pyx_L1_error)
20148 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) __PYX_ERR(0, 926, __pyx_L1_error)
20149 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
20156 __Pyx_RefNannyFinishContext();
20160 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
20165 double __pyx_v_one8;
20166 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20167 __Pyx_Buffer __pyx_pybuffer_v;
20168 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
20169 __Pyx_Buffer __pyx_pybuffer_x;
20170 PyObject *__pyx_r = NULL;
20171 __Pyx_RefNannyDeclarations
20172 npy_intp __pyx_t_1;
20174 npy_intp __pyx_t_3;
20176 npy_intp __pyx_t_5;
20178 Py_ssize_t __pyx_t_7;
20179 Py_ssize_t __pyx_t_8;
20180 Py_ssize_t __pyx_t_9;
20181 Py_ssize_t __pyx_t_10;
20183 Py_ssize_t __pyx_t_12;
20184 Py_ssize_t __pyx_t_13;
20185 Py_ssize_t __pyx_t_14;
20186 Py_ssize_t __pyx_t_15;
20187 Py_ssize_t __pyx_t_16;
20188 Py_ssize_t __pyx_t_17;
20189 Py_ssize_t __pyx_t_18;
20190 Py_ssize_t __pyx_t_19;
20191 Py_ssize_t __pyx_t_20;
20192 Py_ssize_t __pyx_t_21;
20193 Py_ssize_t __pyx_t_22;
20194 Py_ssize_t __pyx_t_23;
20195 Py_ssize_t __pyx_t_24;
20196 Py_ssize_t __pyx_t_25;
20197 Py_ssize_t __pyx_t_26;
20198 Py_ssize_t __pyx_t_27;
20199 Py_ssize_t __pyx_t_28;
20200 Py_ssize_t __pyx_t_29;
20201 Py_ssize_t __pyx_t_30;
20202 Py_ssize_t __pyx_t_31;
20203 Py_ssize_t __pyx_t_32;
20204 Py_ssize_t __pyx_t_33;
20205 Py_ssize_t __pyx_t_34;
20206 Py_ssize_t __pyx_t_35;
20207 Py_ssize_t __pyx_t_36;
20208 Py_ssize_t __pyx_t_37;
20209 Py_ssize_t __pyx_t_38;
20210 Py_ssize_t __pyx_t_39;
20211 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
20212 __pyx_pybuffer_x.pybuffer.buf = NULL;
20213 __pyx_pybuffer_x.refcount = 0;
20214 __pyx_pybuffernd_x.data = NULL;
20215 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
20216 __pyx_pybuffer_v.pybuffer.buf = NULL;
20217 __pyx_pybuffer_v.refcount = 0;
20218 __pyx_pybuffernd_v.data = NULL;
20219 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20221 __Pyx_BufFmt_StackElem __pyx_stack[1];
20222 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20224 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
20226 __Pyx_BufFmt_StackElem __pyx_stack[1];
20227 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 924, __pyx_L1_error)
20229 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
20247 __pyx_v_one8 = (1.0 / 8.0);
20256 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
20257 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
20258 __pyx_v_eN = __pyx_t_2;
20267 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
20268 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20269 __pyx_v_ebN = __pyx_t_4;
20278 __pyx_t_5 = (__pyx_v_x->dimensions[2]);
20279 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20280 __pyx_v_k = __pyx_t_6;
20289 __pyx_t_7 = __pyx_v_eN;
20290 __pyx_t_8 = __pyx_v_ebN;
20291 __pyx_t_9 = __pyx_v_k;
20294 if (__pyx_t_7 < 0) {
20295 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
20296 if (unlikely(__pyx_t_7 < 0)) __pyx_t_11 = 0;
20297 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20298 if (__pyx_t_8 < 0) {
20299 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
20300 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 1;
20301 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20302 if (__pyx_t_9 < 0) {
20303 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
20304 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 2;
20305 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20306 if (__pyx_t_10 < 0) {
20307 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
20308 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 3;
20309 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20310 if (unlikely(__pyx_t_11 != -1)) {
20311 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20312 __PYX_ERR(0, 934, __pyx_L1_error)
20314 __pyx_t_12 = __pyx_v_eN;
20315 __pyx_t_13 = __pyx_v_ebN;
20316 __pyx_t_14 = __pyx_v_k;
20319 if (__pyx_t_12 < 0) {
20320 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[0].shape;
20321 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
20322 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20323 if (__pyx_t_13 < 0) {
20324 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
20325 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
20326 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20327 if (__pyx_t_14 < 0) {
20328 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
20329 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
20330 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20331 if (__pyx_t_15 < 0) {
20332 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
20333 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 3;
20334 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20335 if (unlikely(__pyx_t_11 != -1)) {
20336 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20337 __PYX_ERR(0, 934, __pyx_L1_error)
20339 __pyx_t_16 = __pyx_v_eN;
20340 __pyx_t_17 = __pyx_v_ebN;
20341 __pyx_t_18 = __pyx_v_k;
20344 if (__pyx_t_16 < 0) {
20345 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
20346 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0;
20347 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20348 if (__pyx_t_17 < 0) {
20349 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
20350 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 1;
20351 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20352 if (__pyx_t_18 < 0) {
20353 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[2].shape;
20354 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 2;
20355 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20356 if (__pyx_t_19 < 0) {
20357 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
20358 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 3;
20359 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20360 if (unlikely(__pyx_t_11 != -1)) {
20361 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20362 __PYX_ERR(0, 934, __pyx_L1_error)
20364 __pyx_t_20 = __pyx_v_eN;
20365 __pyx_t_21 = __pyx_v_ebN;
20366 __pyx_t_22 = __pyx_v_k;
20369 if (__pyx_t_20 < 0) {
20370 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[0].shape;
20371 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 0;
20372 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
20373 if (__pyx_t_21 < 0) {
20374 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[1].shape;
20375 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 1;
20376 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
20377 if (__pyx_t_22 < 0) {
20378 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[2].shape;
20379 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 2;
20380 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
20381 if (__pyx_t_23 < 0) {
20382 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
20383 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 3;
20384 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_11 = 3;
20385 if (unlikely(__pyx_t_11 != -1)) {
20386 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20387 __PYX_ERR(0, 934, __pyx_L1_error)
20389 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides)))));
20398 __pyx_t_24 = __pyx_v_eN;
20399 __pyx_t_25 = __pyx_v_ebN;
20400 __pyx_t_26 = __pyx_v_k;
20403 if (__pyx_t_24 < 0) {
20404 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[0].shape;
20405 if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0;
20406 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20407 if (__pyx_t_25 < 0) {
20408 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[1].shape;
20409 if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 1;
20410 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20411 if (__pyx_t_26 < 0) {
20412 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[2].shape;
20413 if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 2;
20414 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20415 if (__pyx_t_27 < 0) {
20416 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[3].shape;
20417 if (unlikely(__pyx_t_27 < 0)) __pyx_t_11 = 3;
20418 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20419 if (unlikely(__pyx_t_11 != -1)) {
20420 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20421 __PYX_ERR(0, 935, __pyx_L1_error)
20423 __pyx_t_28 = __pyx_v_eN;
20424 __pyx_t_29 = __pyx_v_ebN;
20425 __pyx_t_30 = __pyx_v_k;
20428 if (__pyx_t_28 < 0) {
20429 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
20430 if (unlikely(__pyx_t_28 < 0)) __pyx_t_11 = 0;
20431 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20432 if (__pyx_t_29 < 0) {
20433 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
20434 if (unlikely(__pyx_t_29 < 0)) __pyx_t_11 = 1;
20435 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20436 if (__pyx_t_30 < 0) {
20437 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
20438 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 2;
20439 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20440 if (__pyx_t_31 < 0) {
20441 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[3].shape;
20442 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 3;
20443 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20444 if (unlikely(__pyx_t_11 != -1)) {
20445 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20446 __PYX_ERR(0, 935, __pyx_L1_error)
20448 __pyx_t_32 = __pyx_v_eN;
20449 __pyx_t_33 = __pyx_v_ebN;
20450 __pyx_t_34 = __pyx_v_k;
20453 if (__pyx_t_32 < 0) {
20454 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[0].shape;
20455 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0;
20456 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
20457 if (__pyx_t_33 < 0) {
20458 __pyx_t_33 += __pyx_pybuffernd_x.diminfo[1].shape;
20459 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 1;
20460 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
20461 if (__pyx_t_34 < 0) {
20462 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[2].shape;
20463 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 2;
20464 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
20465 if (__pyx_t_35 < 0) {
20466 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[3].shape;
20467 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 3;
20468 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
20469 if (unlikely(__pyx_t_11 != -1)) {
20470 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20471 __PYX_ERR(0, 935, __pyx_L1_error)
20473 __pyx_t_36 = __pyx_v_eN;
20474 __pyx_t_37 = __pyx_v_ebN;
20475 __pyx_t_38 = __pyx_v_k;
20478 if (__pyx_t_36 < 0) {
20479 __pyx_t_36 += __pyx_pybuffernd_v.diminfo[0].shape;
20480 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
20481 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
20482 if (__pyx_t_37 < 0) {
20483 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[1].shape;
20484 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
20485 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
20486 if (__pyx_t_38 < 0) {
20487 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[2].shape;
20488 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
20489 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
20490 if (__pyx_t_39 < 0) {
20491 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[3].shape;
20492 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 3;
20493 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_11 = 3;
20494 if (unlikely(__pyx_t_11 != -1)) {
20495 __Pyx_RaiseBufferIndexError(__pyx_t_11);
20496 __PYX_ERR(0, 935, __pyx_L1_error)
20498 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[3].strides)))));
20512 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20515 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
20516 __Pyx_PyThreadState_declare
20517 __Pyx_PyThreadState_assign
20518 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
20519 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20520 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20521 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
20522 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20526 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
20527 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
20529 __Pyx_XGIVEREF(__pyx_r);
20530 __Pyx_RefNannyFinishContext();
20543 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
20544 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
20546 __Pyx_RefNannyDeclarations
20547 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
20548 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
20551 __Pyx_RefNannyFinishContext();
20555 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
20556 int __pyx_v_copy_shape;
20559 int __pyx_v_endian_detector;
20560 int __pyx_v_little_endian;
20563 PyArray_Descr *__pyx_v_descr = 0;
20564 int __pyx_v_offset;
20565 int __pyx_v_hasfields;
20567 __Pyx_RefNannyDeclarations
20570 PyObject *__pyx_t_3 = NULL;
20573 PyObject *__pyx_t_6 = NULL;
20575 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
20576 if (__pyx_v_info != NULL) {
20577 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
20578 __Pyx_GIVEREF(__pyx_v_info->obj);
20588 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
20601 __pyx_v_endian_detector = 1;
20610 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
20619 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
20628 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
20638 __pyx_v_copy_shape = 1;
20658 __pyx_v_copy_shape = 0;
20669 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
20672 __pyx_t_1 = __pyx_t_2;
20673 goto __pyx_L6_bool_binop_done;
20683 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
20684 __pyx_t_1 = __pyx_t_2;
20685 __pyx_L6_bool_binop_done:;
20703 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __pyx_L1_error)
20704 __Pyx_GOTREF(__pyx_t_3);
20705 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20706 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20707 __PYX_ERR(1, 218, __pyx_L1_error)
20725 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
20728 __pyx_t_1 = __pyx_t_2;
20729 goto __pyx_L9_bool_binop_done;
20739 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
20740 __pyx_t_1 = __pyx_t_2;
20741 __pyx_L9_bool_binop_done:;
20759 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __pyx_L1_error)
20760 __Pyx_GOTREF(__pyx_t_3);
20761 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20762 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20763 __PYX_ERR(1, 222, __pyx_L1_error)
20781 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
20790 __pyx_v_info->ndim = __pyx_v_ndim;
20799 __pyx_t_1 = (__pyx_v_copy_shape != 0);
20809 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((
sizeof(Py_ssize_t)) * ((
size_t)__pyx_v_ndim)) * 2)));
20818 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
20827 __pyx_t_4 = __pyx_v_ndim;
20828 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
20829 __pyx_v_i = __pyx_t_5;
20838 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
20847 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
20868 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
20877 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
20888 __pyx_v_info->suboffsets = NULL;
20897 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
20906 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
20924 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
20925 __Pyx_INCREF(__pyx_t_3);
20926 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
20936 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
20945 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
20948 __pyx_t_1 = __pyx_t_2;
20949 goto __pyx_L15_bool_binop_done;
20951 __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
20952 __pyx_t_1 = __pyx_t_2;
20953 __pyx_L15_bool_binop_done:;
20963 __Pyx_INCREF(Py_None);
20964 __Pyx_GIVEREF(Py_None);
20965 __Pyx_GOTREF(__pyx_v_info->obj);
20966 __Pyx_DECREF(__pyx_v_info->obj);
20967 __pyx_v_info->obj = Py_None;
20987 __Pyx_INCREF(((PyObject *)__pyx_v_self));
20988 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20989 __Pyx_GOTREF(__pyx_v_info->obj);
20990 __Pyx_DECREF(__pyx_v_info->obj);
20991 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
21002 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
21012 __pyx_t_4 = __pyx_v_descr->type_num;
21013 __pyx_v_t = __pyx_t_4;
21022 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
21024 goto __pyx_L20_next_or;
21027 __pyx_t_2 = (__pyx_v_little_endian != 0);
21030 __pyx_t_1 = __pyx_t_2;
21031 goto __pyx_L19_bool_binop_done;
21033 __pyx_L20_next_or:;
21042 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
21045 __pyx_t_1 = __pyx_t_2;
21046 goto __pyx_L19_bool_binop_done;
21048 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
21049 __pyx_t_1 = __pyx_t_2;
21050 __pyx_L19_bool_binop_done:;
21068 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
21069 __Pyx_GOTREF(__pyx_t_3);
21070 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21071 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21072 __PYX_ERR(1, 259, __pyx_L1_error)
21090 switch (__pyx_v_t) {
21092 __pyx_v_f = ((
char *)
"b");
21103 __pyx_v_f = ((
char *)
"B");
21114 __pyx_v_f = ((
char *)
"h");
21125 __pyx_v_f = ((
char *)
"H");
21136 __pyx_v_f = ((
char *)
"i");
21147 __pyx_v_f = ((
char *)
"I");
21158 __pyx_v_f = ((
char *)
"l");
21169 __pyx_v_f = ((
char *)
"L");
21180 __pyx_v_f = ((
char *)
"q");
21190 case NPY_ULONGLONG:
21191 __pyx_v_f = ((
char *)
"Q");
21202 __pyx_v_f = ((
char *)
"f");
21213 __pyx_v_f = ((
char *)
"d");
21223 case NPY_LONGDOUBLE:
21224 __pyx_v_f = ((
char *)
"g");
21235 __pyx_v_f = ((
char *)
"Zf");
21246 __pyx_v_f = ((
char *)
"Zd");
21256 case NPY_CLONGDOUBLE:
21257 __pyx_v_f = ((
char *)
"Zg");
21268 __pyx_v_f = ((
char *)
"O");
21279 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
21280 __Pyx_GOTREF(__pyx_t_3);
21281 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
21282 __Pyx_GOTREF(__pyx_t_6);
21283 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21284 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
21285 __Pyx_GOTREF(__pyx_t_3);
21286 __Pyx_GIVEREF(__pyx_t_6);
21287 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
21289 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L1_error)
21290 __Pyx_GOTREF(__pyx_t_6);
21291 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21292 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
21293 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21294 __PYX_ERR(1, 278, __pyx_L1_error)
21305 __pyx_v_info->format = __pyx_v_f;
21334 __pyx_v_info->format = ((
char *)malloc(0xFF));
21343 (__pyx_v_info->format[0]) =
'^';
21352 __pyx_v_offset = 0;
21361 __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
21362 __pyx_v_f = __pyx_t_7;
21371 (__pyx_v_f[0]) =
'\x00';
21386 __Pyx_XDECREF(__pyx_t_3);
21387 __Pyx_XDECREF(__pyx_t_6);
21388 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21390 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
21391 __Pyx_GOTREF(__pyx_v_info->obj);
21392 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
21396 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
21397 __Pyx_GOTREF(Py_None);
21398 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
21401 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
21402 __Pyx_RefNannyFinishContext();
21415 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
21416 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
21417 __Pyx_RefNannyDeclarations
21418 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
21419 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
21422 __Pyx_RefNannyFinishContext();
21425 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
21426 __Pyx_RefNannyDeclarations
21428 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
21437 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
21447 free(__pyx_v_info->format);
21465 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
21475 free(__pyx_v_info->strides);
21495 __Pyx_RefNannyFinishContext();
21506 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
21507 PyObject *__pyx_r = NULL;
21508 __Pyx_RefNannyDeclarations
21509 PyObject *__pyx_t_1 = NULL;
21510 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
21519 __Pyx_XDECREF(__pyx_r);
21520 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __pyx_L1_error)
21521 __Pyx_GOTREF(__pyx_t_1);
21522 __pyx_r = __pyx_t_1;
21536 __Pyx_XDECREF(__pyx_t_1);
21537 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
21540 __Pyx_XGIVEREF(__pyx_r);
21541 __Pyx_RefNannyFinishContext();
21553 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
21554 PyObject *__pyx_r = NULL;
21555 __Pyx_RefNannyDeclarations
21556 PyObject *__pyx_t_1 = NULL;
21557 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
21566 __Pyx_XDECREF(__pyx_r);
21567 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __pyx_L1_error)
21568 __Pyx_GOTREF(__pyx_t_1);
21569 __pyx_r = __pyx_t_1;
21583 __Pyx_XDECREF(__pyx_t_1);
21584 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
21587 __Pyx_XGIVEREF(__pyx_r);
21588 __Pyx_RefNannyFinishContext();
21600 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
21601 PyObject *__pyx_r = NULL;
21602 __Pyx_RefNannyDeclarations
21603 PyObject *__pyx_t_1 = NULL;
21604 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
21613 __Pyx_XDECREF(__pyx_r);
21614 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __pyx_L1_error)
21615 __Pyx_GOTREF(__pyx_t_1);
21616 __pyx_r = __pyx_t_1;
21630 __Pyx_XDECREF(__pyx_t_1);
21631 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
21634 __Pyx_XGIVEREF(__pyx_r);
21635 __Pyx_RefNannyFinishContext();
21647 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
21648 PyObject *__pyx_r = NULL;
21649 __Pyx_RefNannyDeclarations
21650 PyObject *__pyx_t_1 = NULL;
21651 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
21660 __Pyx_XDECREF(__pyx_r);
21661 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 780, __pyx_L1_error)
21662 __Pyx_GOTREF(__pyx_t_1);
21663 __pyx_r = __pyx_t_1;
21677 __Pyx_XDECREF(__pyx_t_1);
21678 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
21681 __Pyx_XGIVEREF(__pyx_r);
21682 __Pyx_RefNannyFinishContext();
21694 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
21695 PyObject *__pyx_r = NULL;
21696 __Pyx_RefNannyDeclarations
21697 PyObject *__pyx_t_1 = NULL;
21698 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
21707 __Pyx_XDECREF(__pyx_r);
21708 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
21709 __Pyx_GOTREF(__pyx_t_1);
21710 __pyx_r = __pyx_t_1;
21724 __Pyx_XDECREF(__pyx_t_1);
21725 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21728 __Pyx_XGIVEREF(__pyx_r);
21729 __Pyx_RefNannyFinishContext();
21741 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
21742 PyArray_Descr *__pyx_v_child = 0;
21743 int __pyx_v_endian_detector;
21744 int __pyx_v_little_endian;
21745 PyObject *__pyx_v_fields = 0;
21746 PyObject *__pyx_v_childname = NULL;
21747 PyObject *__pyx_v_new_offset = NULL;
21748 PyObject *__pyx_v_t = NULL;
21750 __Pyx_RefNannyDeclarations
21751 PyObject *__pyx_t_1 = NULL;
21752 Py_ssize_t __pyx_t_2;
21753 PyObject *__pyx_t_3 = NULL;
21754 PyObject *__pyx_t_4 = NULL;
21760 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
21769 __pyx_v_endian_detector = 1;
21778 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
21787 if (unlikely(__pyx_v_descr->names == Py_None)) {
21788 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
21789 __PYX_ERR(1, 794, __pyx_L1_error)
21791 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
21793 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
21794 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 21795 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(1, 794, __pyx_L1_error)
21797 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
21798 __Pyx_GOTREF(__pyx_t_3);
21800 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
21810 if (unlikely(__pyx_v_descr->fields == Py_None)) {
21811 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21812 __PYX_ERR(1, 795, __pyx_L1_error)
21814 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __pyx_L1_error)
21815 __Pyx_GOTREF(__pyx_t_3);
21816 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(1, 795, __pyx_L1_error)
21817 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
21827 if (likely(__pyx_v_fields != Py_None)) {
21828 PyObject* sequence = __pyx_v_fields;
21829 #if !CYTHON_COMPILING_IN_PYPY 21830 Py_ssize_t size = Py_SIZE(sequence);
21832 Py_ssize_t size = PySequence_Size(sequence);
21834 if (unlikely(size != 2)) {
21835 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21836 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21837 __PYX_ERR(1, 796, __pyx_L1_error)
21839 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 21840 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
21841 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
21842 __Pyx_INCREF(__pyx_t_3);
21843 __Pyx_INCREF(__pyx_t_4);
21845 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __pyx_L1_error)
21846 __Pyx_GOTREF(__pyx_t_3);
21847 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __pyx_L1_error)
21848 __Pyx_GOTREF(__pyx_t_4);
21851 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __pyx_L1_error)
21853 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __pyx_L1_error)
21854 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
21856 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
21866 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __pyx_L1_error)
21867 __Pyx_GOTREF(__pyx_t_4);
21868 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __pyx_L1_error)
21869 __Pyx_GOTREF(__pyx_t_3);
21870 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21871 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __pyx_L1_error)
21872 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21873 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
21883 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __pyx_L1_error)
21884 __Pyx_GOTREF(__pyx_t_3);
21885 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21886 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21887 __PYX_ERR(1, 799, __pyx_L1_error)
21905 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
21907 goto __pyx_L8_next_or;
21910 __pyx_t_7 = (__pyx_v_little_endian != 0);
21913 __pyx_t_6 = __pyx_t_7;
21914 goto __pyx_L7_bool_binop_done;
21925 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
21928 __pyx_t_6 = __pyx_t_7;
21929 goto __pyx_L7_bool_binop_done;
21931 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
21932 __pyx_t_6 = __pyx_t_7;
21933 __pyx_L7_bool_binop_done:;
21951 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
21952 __Pyx_GOTREF(__pyx_t_3);
21953 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21954 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21955 __PYX_ERR(1, 803, __pyx_L1_error)
21974 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __pyx_L1_error)
21975 __Pyx_GOTREF(__pyx_t_3);
21976 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __pyx_L1_error)
21977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21978 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __pyx_L1_error)
21979 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21980 if (!__pyx_t_6)
break;
21989 (__pyx_v_f[0]) = 0x78;
21998 __pyx_v_f = (__pyx_v_f + 1);
22008 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
22019 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
22028 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
22038 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __pyx_L1_error)
22039 __Pyx_GOTREF(__pyx_t_4);
22040 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
22050 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
22060 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __pyx_L1_error)
22061 __Pyx_GOTREF(__pyx_t_4);
22062 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22064 __PYX_ERR(1, 823, __pyx_L1_error)
22082 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __pyx_L1_error)
22083 __Pyx_GOTREF(__pyx_t_4);
22084 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __pyx_L1_error)
22085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22086 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __pyx_L1_error)
22087 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22089 (__pyx_v_f[0]) = 98;
22100 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
22101 __Pyx_GOTREF(__pyx_t_3);
22102 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __pyx_L1_error)
22103 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22104 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __pyx_L1_error)
22105 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22107 (__pyx_v_f[0]) = 66;
22118 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __pyx_L1_error)
22119 __Pyx_GOTREF(__pyx_t_4);
22120 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __pyx_L1_error)
22121 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22122 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
22123 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22125 (__pyx_v_f[0]) = 0x68;
22136 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __pyx_L1_error)
22137 __Pyx_GOTREF(__pyx_t_3);
22138 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __pyx_L1_error)
22139 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22140 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __pyx_L1_error)
22141 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22143 (__pyx_v_f[0]) = 72;
22154 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __pyx_L1_error)
22155 __Pyx_GOTREF(__pyx_t_4);
22156 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __pyx_L1_error)
22157 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22158 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
22159 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22161 (__pyx_v_f[0]) = 0x69;
22172 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __pyx_L1_error)
22173 __Pyx_GOTREF(__pyx_t_3);
22174 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __pyx_L1_error)
22175 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22176 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __pyx_L1_error)
22177 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22179 (__pyx_v_f[0]) = 73;
22190 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
22191 __Pyx_GOTREF(__pyx_t_4);
22192 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __pyx_L1_error)
22193 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22194 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
22195 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22197 (__pyx_v_f[0]) = 0x6C;
22208 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __pyx_L1_error)
22209 __Pyx_GOTREF(__pyx_t_3);
22210 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __pyx_L1_error)
22211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22212 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __pyx_L1_error)
22213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22215 (__pyx_v_f[0]) = 76;
22226 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
22227 __Pyx_GOTREF(__pyx_t_4);
22228 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __pyx_L1_error)
22229 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22230 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
22231 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22233 (__pyx_v_f[0]) = 0x71;
22244 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __pyx_L1_error)
22245 __Pyx_GOTREF(__pyx_t_3);
22246 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __pyx_L1_error)
22247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22248 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __pyx_L1_error)
22249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22251 (__pyx_v_f[0]) = 81;
22262 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __pyx_L1_error)
22263 __Pyx_GOTREF(__pyx_t_4);
22264 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __pyx_L1_error)
22265 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22266 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
22267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22269 (__pyx_v_f[0]) = 0x66;
22280 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __pyx_L1_error)
22281 __Pyx_GOTREF(__pyx_t_3);
22282 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
22283 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22284 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
22285 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22287 (__pyx_v_f[0]) = 0x64;
22298 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __pyx_L1_error)
22299 __Pyx_GOTREF(__pyx_t_4);
22300 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
22301 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22302 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
22303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22305 (__pyx_v_f[0]) = 0x67;
22316 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __pyx_L1_error)
22317 __Pyx_GOTREF(__pyx_t_3);
22318 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
22319 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22320 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
22321 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22323 (__pyx_v_f[0]) = 90;
22324 (__pyx_v_f[1]) = 0x66;
22325 __pyx_v_f = (__pyx_v_f + 1);
22336 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __pyx_L1_error)
22337 __Pyx_GOTREF(__pyx_t_4);
22338 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
22339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22340 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
22341 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22343 (__pyx_v_f[0]) = 90;
22344 (__pyx_v_f[1]) = 0x64;
22345 __pyx_v_f = (__pyx_v_f + 1);
22356 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __pyx_L1_error)
22357 __Pyx_GOTREF(__pyx_t_3);
22358 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
22359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22360 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
22361 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22363 (__pyx_v_f[0]) = 90;
22364 (__pyx_v_f[1]) = 0x67;
22365 __pyx_v_f = (__pyx_v_f + 1);
22376 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __pyx_L1_error)
22377 __Pyx_GOTREF(__pyx_t_4);
22378 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
22379 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22380 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
22381 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22383 (__pyx_v_f[0]) = 79;
22395 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
22396 __Pyx_GOTREF(__pyx_t_3);
22397 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
22398 __Pyx_GOTREF(__pyx_t_4);
22399 __Pyx_GIVEREF(__pyx_t_3);
22400 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
22402 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
22403 __Pyx_GOTREF(__pyx_t_3);
22404 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22405 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22406 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22407 __PYX_ERR(1, 844, __pyx_L1_error)
22418 __pyx_v_f = (__pyx_v_f + 1);
22438 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(1, 849, __pyx_L1_error)
22439 __pyx_v_f = __pyx_t_9;
22451 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22460 __pyx_r = __pyx_v_f;
22473 __Pyx_XDECREF(__pyx_t_1);
22474 __Pyx_XDECREF(__pyx_t_3);
22475 __Pyx_XDECREF(__pyx_t_4);
22476 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
22479 __Pyx_XDECREF((PyObject *)__pyx_v_child);
22480 __Pyx_XDECREF(__pyx_v_fields);
22481 __Pyx_XDECREF(__pyx_v_childname);
22482 __Pyx_XDECREF(__pyx_v_new_offset);
22483 __Pyx_XDECREF(__pyx_v_t);
22484 __Pyx_RefNannyFinishContext();
22496 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
22497 PyObject *__pyx_v_baseptr;
22498 __Pyx_RefNannyDeclarations
22501 __Pyx_RefNannySetupContext(
"set_array_base", 0);
22510 __pyx_t_1 = (__pyx_v_base == Py_None);
22511 __pyx_t_2 = (__pyx_t_1 != 0);
22521 __pyx_v_baseptr = NULL;
22541 Py_INCREF(__pyx_v_base);
22550 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
22561 Py_XDECREF(__pyx_v_arr->base);
22570 __pyx_v_arr->base = __pyx_v_baseptr;
22581 __Pyx_RefNannyFinishContext();
22592 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
22593 PyObject *__pyx_r = NULL;
22594 __Pyx_RefNannyDeclarations
22596 __Pyx_RefNannySetupContext(
"get_array_base", 0);
22605 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
22615 __Pyx_XDECREF(__pyx_r);
22616 __Pyx_INCREF(Py_None);
22637 __Pyx_XDECREF(__pyx_r);
22638 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
22639 __pyx_r = ((PyObject *)__pyx_v_arr->base);
22653 __Pyx_XGIVEREF(__pyx_r);
22654 __Pyx_RefNannyFinishContext();
22666 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
22668 __Pyx_RefNannyDeclarations
22669 PyObject *__pyx_t_1 = NULL;
22670 PyObject *__pyx_t_2 = NULL;
22671 PyObject *__pyx_t_3 = NULL;
22673 PyObject *__pyx_t_5 = NULL;
22674 PyObject *__pyx_t_6 = NULL;
22675 PyObject *__pyx_t_7 = NULL;
22676 PyObject *__pyx_t_8 = NULL;
22677 __Pyx_RefNannySetupContext(
"import_array", 0);
22687 __Pyx_PyThreadState_declare
22688 __Pyx_PyThreadState_assign
22689 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22690 __Pyx_XGOTREF(__pyx_t_1);
22691 __Pyx_XGOTREF(__pyx_t_2);
22692 __Pyx_XGOTREF(__pyx_t_3);
22702 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
22712 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22713 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22714 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22715 goto __pyx_L10_try_end;
22717 __Pyx_PyThreadState_assign
22726 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22728 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22729 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
22730 __Pyx_GOTREF(__pyx_t_5);
22731 __Pyx_GOTREF(__pyx_t_6);
22732 __Pyx_GOTREF(__pyx_t_7);
22741 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
22742 __Pyx_GOTREF(__pyx_t_8);
22743 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22744 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22745 __PYX_ERR(1, 989, __pyx_L5_except_error)
22747 goto __pyx_L5_except_error;
22748 __pyx_L5_except_error:;
22757 __Pyx_PyThreadState_assign
22758 __Pyx_XGIVEREF(__pyx_t_1);
22759 __Pyx_XGIVEREF(__pyx_t_2);
22760 __Pyx_XGIVEREF(__pyx_t_3);
22761 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22762 goto __pyx_L1_error;
22763 __pyx_L10_try_end:;
22778 __Pyx_XDECREF(__pyx_t_5);
22779 __Pyx_XDECREF(__pyx_t_6);
22780 __Pyx_XDECREF(__pyx_t_7);
22781 __Pyx_XDECREF(__pyx_t_8);
22782 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
22785 __Pyx_RefNannyFinishContext();
22797 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
22799 __Pyx_RefNannyDeclarations
22800 PyObject *__pyx_t_1 = NULL;
22801 PyObject *__pyx_t_2 = NULL;
22802 PyObject *__pyx_t_3 = NULL;
22804 PyObject *__pyx_t_5 = NULL;
22805 PyObject *__pyx_t_6 = NULL;
22806 PyObject *__pyx_t_7 = NULL;
22807 PyObject *__pyx_t_8 = NULL;
22808 __Pyx_RefNannySetupContext(
"import_umath", 0);
22818 __Pyx_PyThreadState_declare
22819 __Pyx_PyThreadState_assign
22820 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22821 __Pyx_XGOTREF(__pyx_t_1);
22822 __Pyx_XGOTREF(__pyx_t_2);
22823 __Pyx_XGOTREF(__pyx_t_3);
22833 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
22843 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22844 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22845 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22846 goto __pyx_L10_try_end;
22848 __Pyx_PyThreadState_assign
22857 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22859 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22860 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
22861 __Pyx_GOTREF(__pyx_t_5);
22862 __Pyx_GOTREF(__pyx_t_6);
22863 __Pyx_GOTREF(__pyx_t_7);
22872 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
22873 __Pyx_GOTREF(__pyx_t_8);
22874 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
22875 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22876 __PYX_ERR(1, 995, __pyx_L5_except_error)
22878 goto __pyx_L5_except_error;
22879 __pyx_L5_except_error:;
22888 __Pyx_PyThreadState_assign
22889 __Pyx_XGIVEREF(__pyx_t_1);
22890 __Pyx_XGIVEREF(__pyx_t_2);
22891 __Pyx_XGIVEREF(__pyx_t_3);
22892 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
22893 goto __pyx_L1_error;
22894 __pyx_L10_try_end:;
22909 __Pyx_XDECREF(__pyx_t_5);
22910 __Pyx_XDECREF(__pyx_t_6);
22911 __Pyx_XDECREF(__pyx_t_7);
22912 __Pyx_XDECREF(__pyx_t_8);
22913 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
22916 __Pyx_RefNannyFinishContext();
22928 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
22930 __Pyx_RefNannyDeclarations
22931 PyObject *__pyx_t_1 = NULL;
22932 PyObject *__pyx_t_2 = NULL;
22933 PyObject *__pyx_t_3 = NULL;
22935 PyObject *__pyx_t_5 = NULL;
22936 PyObject *__pyx_t_6 = NULL;
22937 PyObject *__pyx_t_7 = NULL;
22938 PyObject *__pyx_t_8 = NULL;
22939 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
22949 __Pyx_PyThreadState_declare
22950 __Pyx_PyThreadState_assign
22951 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
22952 __Pyx_XGOTREF(__pyx_t_1);
22953 __Pyx_XGOTREF(__pyx_t_2);
22954 __Pyx_XGOTREF(__pyx_t_3);
22964 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
22974 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22975 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22976 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22977 goto __pyx_L10_try_end;
22979 __Pyx_PyThreadState_assign
22987 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
22989 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22990 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
22991 __Pyx_GOTREF(__pyx_t_5);
22992 __Pyx_GOTREF(__pyx_t_6);
22993 __Pyx_GOTREF(__pyx_t_7);
23000 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
23001 __Pyx_GOTREF(__pyx_t_8);
23002 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
23003 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
23004 __PYX_ERR(1, 1001, __pyx_L5_except_error)
23006 goto __pyx_L5_except_error;
23007 __pyx_L5_except_error:;
23016 __Pyx_PyThreadState_assign
23017 __Pyx_XGIVEREF(__pyx_t_1);
23018 __Pyx_XGIVEREF(__pyx_t_2);
23019 __Pyx_XGIVEREF(__pyx_t_3);
23020 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
23021 goto __pyx_L1_error;
23022 __pyx_L10_try_end:;
23037 __Pyx_XDECREF(__pyx_t_5);
23038 __Pyx_XDECREF(__pyx_t_6);
23039 __Pyx_XDECREF(__pyx_t_7);
23040 __Pyx_XDECREF(__pyx_t_8);
23041 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
23044 __Pyx_RefNannyFinishContext();
23048 static PyMethodDef __pyx_methods[] = {
23052 #if PY_MAJOR_VERSION >= 3 23053 static struct PyModuleDef __pyx_moduledef = {
23054 #if PY_VERSION_HEX < 0x03020000 23055 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
23057 PyModuleDef_HEAD_INIT,
23059 "subsurfaceTransportFunctions",
23070 static __Pyx_StringTabEntry __pyx_string_tab[] = {
23071 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
23072 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
23073 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
23074 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
23075 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
23076 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
23077 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
23078 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
23079 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
23080 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
23081 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
23082 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
23083 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
23084 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
23085 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
23086 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
23087 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
23088 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
23089 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
23090 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
23091 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
23092 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
23093 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
23094 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
23095 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
23096 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
23097 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
23098 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
23099 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
23100 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
23101 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
23102 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
23103 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
23104 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
23105 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
23106 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
23107 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
23108 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
23109 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
23110 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
23111 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
23112 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
23113 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
23114 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
23115 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
23116 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
23117 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
23118 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
23119 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
23120 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
23121 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
23122 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
23123 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
23124 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
23125 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
23126 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
23127 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
23128 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
23129 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
23130 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
23131 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
23132 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
23133 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
23134 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
23135 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
23136 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
23137 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
23138 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
23139 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
23140 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
23141 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
23142 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
23143 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
23144 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
23145 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
23146 {&__pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_k_home_cekees_proteus_proteus_sub,
sizeof(__pyx_k_home_cekees_proteus_proteus_sub), 0, 0, 1, 0},
23147 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
23148 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
23149 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
23150 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
23151 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
23152 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
23153 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
23154 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
23155 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
23156 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
23157 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
23158 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
23159 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
23160 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
23161 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
23162 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
23163 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
23164 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
23165 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
23166 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
23167 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
23168 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
23169 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
23170 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
23171 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
23172 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
23173 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
23174 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
23175 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
23176 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
23177 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
23178 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
23179 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
23180 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
23181 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
23182 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
23183 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
23184 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
23185 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
23186 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
23187 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
23188 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
23189 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
23190 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
23191 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
23192 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
23193 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
23194 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
23195 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
23196 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
23197 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
23198 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
23199 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
23200 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
23201 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
23202 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
23203 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
23204 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
23205 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
23206 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
23207 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
23208 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
23209 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
23210 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
23211 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
23212 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
23213 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
23214 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
23215 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
23216 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
23217 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
23218 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
23219 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
23220 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
23221 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
23222 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
23223 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
23224 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
23225 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
23226 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
23227 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
23228 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
23229 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
23230 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
23231 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
23232 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
23233 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
23234 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
23235 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
23236 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
23237 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
23238 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
23239 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
23240 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
23241 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
23242 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
23243 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
23244 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
23245 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
23246 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
23247 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
23248 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
23249 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
23250 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
23251 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
23252 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
23253 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
23254 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
23255 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
23256 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
23257 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
23258 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
23259 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
23260 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
23261 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
23262 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
23263 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
23264 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
23265 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
23266 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
23267 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
23268 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
23269 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
23270 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
23271 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
23272 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
23273 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
23274 {0, 0, 0, 0, 0, 0, 0}
23276 static int __Pyx_InitCachedBuiltins(
void) {
23277 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(0, 24, __pyx_L1_error)
23278 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
23279 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
23280 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
23286 static int __Pyx_InitCachedConstants(
void) {
23287 __Pyx_RefNannyDeclarations
23288 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
23297 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 66, __pyx_L1_error)
23298 __Pyx_GOTREF(__pyx_slice_);
23299 __Pyx_GIVEREF(__pyx_slice_);
23308 __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 192, __pyx_L1_error)
23309 __Pyx_GOTREF(__pyx_slice__2);
23310 __Pyx_GIVEREF(__pyx_slice__2);
23319 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 794, __pyx_L1_error)
23320 __Pyx_GOTREF(__pyx_slice__3);
23321 __Pyx_GIVEREF(__pyx_slice__3);
23330 __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 808, __pyx_L1_error)
23331 __Pyx_GOTREF(__pyx_slice__4);
23332 __Pyx_GIVEREF(__pyx_slice__4);
23341 __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 835, __pyx_L1_error)
23342 __Pyx_GOTREF(__pyx_slice__5);
23343 __Pyx_GIVEREF(__pyx_slice__5);
23352 __pyx_slice__6 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 851, __pyx_L1_error)
23353 __Pyx_GOTREF(__pyx_slice__6);
23354 __Pyx_GIVEREF(__pyx_slice__6);
23363 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) __PYX_ERR(0, 876, __pyx_L1_error)
23364 __Pyx_GOTREF(__pyx_slice__7);
23365 __Pyx_GIVEREF(__pyx_slice__7);
23374 __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 902, __pyx_L1_error)
23375 __Pyx_GOTREF(__pyx_slice__8);
23376 __Pyx_GIVEREF(__pyx_slice__8);
23385 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 218, __pyx_L1_error)
23386 __Pyx_GOTREF(__pyx_tuple__9);
23387 __Pyx_GIVEREF(__pyx_tuple__9);
23396 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 222, __pyx_L1_error)
23397 __Pyx_GOTREF(__pyx_tuple__10);
23398 __Pyx_GIVEREF(__pyx_tuple__10);
23407 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 259, __pyx_L1_error)
23408 __Pyx_GOTREF(__pyx_tuple__11);
23409 __Pyx_GIVEREF(__pyx_tuple__11);
23418 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 799, __pyx_L1_error)
23419 __Pyx_GOTREF(__pyx_tuple__12);
23420 __Pyx_GIVEREF(__pyx_tuple__12);
23429 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 803, __pyx_L1_error)
23430 __Pyx_GOTREF(__pyx_tuple__13);
23431 __Pyx_GIVEREF(__pyx_tuple__13);
23440 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 823, __pyx_L1_error)
23441 __Pyx_GOTREF(__pyx_tuple__14);
23442 __Pyx_GIVEREF(__pyx_tuple__14);
23451 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 989, __pyx_L1_error)
23452 __Pyx_GOTREF(__pyx_tuple__15);
23453 __Pyx_GIVEREF(__pyx_tuple__15);
23462 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 995, __pyx_L1_error)
23463 __Pyx_GOTREF(__pyx_tuple__16);
23464 __Pyx_GIVEREF(__pyx_tuple__16);
23471 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 1001, __pyx_L1_error)
23472 __Pyx_GOTREF(__pyx_tuple__17);
23473 __Pyx_GIVEREF(__pyx_tuple__17);
23482 __pyx_tuple__18 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 18, __pyx_L1_error)
23483 __Pyx_GOTREF(__pyx_tuple__18);
23484 __Pyx_GIVEREF(__pyx_tuple__18);
23485 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 18, __pyx_L1_error)
23494 __pyx_tuple__20 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 29, __pyx_L1_error)
23495 __Pyx_GOTREF(__pyx_tuple__20);
23496 __Pyx_GIVEREF(__pyx_tuple__20);
23497 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 29, __pyx_L1_error)
23506 __pyx_tuple__22 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 43, __pyx_L1_error)
23507 __Pyx_GOTREF(__pyx_tuple__22);
23508 __Pyx_GIVEREF(__pyx_tuple__22);
23509 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 43, __pyx_L1_error)
23518 __pyx_tuple__24 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 56, __pyx_L1_error)
23519 __Pyx_GOTREF(__pyx_tuple__24);
23520 __Pyx_GIVEREF(__pyx_tuple__24);
23521 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 56, __pyx_L1_error)
23530 __pyx_tuple__26 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 69, __pyx_L1_error)
23531 __Pyx_GOTREF(__pyx_tuple__26);
23532 __Pyx_GIVEREF(__pyx_tuple__26);
23533 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 69, __pyx_L1_error)
23542 __pyx_tuple__28 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 91, __pyx_L1_error)
23543 __Pyx_GOTREF(__pyx_tuple__28);
23544 __Pyx_GIVEREF(__pyx_tuple__28);
23545 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 91, __pyx_L1_error)
23554 __pyx_tuple__30 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 118, __pyx_L1_error)
23555 __Pyx_GOTREF(__pyx_tuple__30);
23556 __Pyx_GIVEREF(__pyx_tuple__30);
23557 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 118, __pyx_L1_error)
23566 __pyx_tuple__32 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 139, __pyx_L1_error)
23567 __Pyx_GOTREF(__pyx_tuple__32);
23568 __Pyx_GIVEREF(__pyx_tuple__32);
23569 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 139, __pyx_L1_error)
23578 __pyx_tuple__34 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 165, __pyx_L1_error)
23579 __Pyx_GOTREF(__pyx_tuple__34);
23580 __Pyx_GIVEREF(__pyx_tuple__34);
23581 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 165, __pyx_L1_error)
23590 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 180, __pyx_L1_error)
23591 __Pyx_GOTREF(__pyx_tuple__36);
23592 __Pyx_GIVEREF(__pyx_tuple__36);
23593 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 180, __pyx_L1_error)
23602 __pyx_tuple__38 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 195, __pyx_L1_error)
23603 __Pyx_GOTREF(__pyx_tuple__38);
23604 __Pyx_GIVEREF(__pyx_tuple__38);
23605 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 195, __pyx_L1_error)
23614 __pyx_tuple__40 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 219, __pyx_L1_error)
23615 __Pyx_GOTREF(__pyx_tuple__40);
23616 __Pyx_GIVEREF(__pyx_tuple__40);
23617 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 219, __pyx_L1_error)
23626 __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 248, __pyx_L1_error)
23627 __Pyx_GOTREF(__pyx_tuple__42);
23628 __Pyx_GIVEREF(__pyx_tuple__42);
23629 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 248, __pyx_L1_error)
23638 __pyx_tuple__44 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 271, __pyx_L1_error)
23639 __Pyx_GOTREF(__pyx_tuple__44);
23640 __Pyx_GIVEREF(__pyx_tuple__44);
23641 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 271, __pyx_L1_error)
23650 __pyx_tuple__46 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 301, __pyx_L1_error)
23651 __Pyx_GOTREF(__pyx_tuple__46);
23652 __Pyx_GIVEREF(__pyx_tuple__46);
23653 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 301, __pyx_L1_error)
23662 __pyx_tuple__48 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 359, __pyx_L1_error)
23663 __Pyx_GOTREF(__pyx_tuple__48);
23664 __Pyx_GIVEREF(__pyx_tuple__48);
23665 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 359, __pyx_L1_error)
23674 __pyx_tuple__50 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 486, __pyx_L1_error)
23675 __Pyx_GOTREF(__pyx_tuple__50);
23676 __Pyx_GIVEREF(__pyx_tuple__50);
23677 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 486, __pyx_L1_error)
23686 __pyx_tuple__52 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 574, __pyx_L1_error)
23687 __Pyx_GOTREF(__pyx_tuple__52);
23688 __Pyx_GIVEREF(__pyx_tuple__52);
23689 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 574, __pyx_L1_error)
23698 __pyx_tuple__54 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 673, __pyx_L1_error)
23699 __Pyx_GOTREF(__pyx_tuple__54);
23700 __Pyx_GIVEREF(__pyx_tuple__54);
23701 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 673, __pyx_L1_error)
23710 __pyx_tuple__56 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 692, __pyx_L1_error)
23711 __Pyx_GOTREF(__pyx_tuple__56);
23712 __Pyx_GIVEREF(__pyx_tuple__56);
23713 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 692, __pyx_L1_error)
23722 __pyx_tuple__58 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 717, __pyx_L1_error)
23723 __Pyx_GOTREF(__pyx_tuple__58);
23724 __Pyx_GIVEREF(__pyx_tuple__58);
23725 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 717, __pyx_L1_error)
23734 __pyx_tuple__60 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 732, __pyx_L1_error)
23735 __Pyx_GOTREF(__pyx_tuple__60);
23736 __Pyx_GIVEREF(__pyx_tuple__60);
23737 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 732, __pyx_L1_error)
23746 __pyx_tuple__62 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 753, __pyx_L1_error)
23747 __Pyx_GOTREF(__pyx_tuple__62);
23748 __Pyx_GIVEREF(__pyx_tuple__62);
23749 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 753, __pyx_L1_error)
23758 __pyx_tuple__64 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 776, __pyx_L1_error)
23759 __Pyx_GOTREF(__pyx_tuple__64);
23760 __Pyx_GIVEREF(__pyx_tuple__64);
23761 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 776, __pyx_L1_error)
23770 __pyx_tuple__66 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 816, __pyx_L1_error)
23771 __Pyx_GOTREF(__pyx_tuple__66);
23772 __Pyx_GIVEREF(__pyx_tuple__66);
23773 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 816, __pyx_L1_error)
23782 __pyx_tuple__68 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 859, __pyx_L1_error)
23783 __Pyx_GOTREF(__pyx_tuple__68);
23784 __Pyx_GIVEREF(__pyx_tuple__68);
23785 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 859, __pyx_L1_error)
23794 __pyx_tuple__70 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 884, __pyx_L1_error)
23795 __Pyx_GOTREF(__pyx_tuple__70);
23796 __Pyx_GIVEREF(__pyx_tuple__70);
23797 __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 884, __pyx_L1_error)
23806 __pyx_tuple__72 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 911, __pyx_L1_error)
23807 __Pyx_GOTREF(__pyx_tuple__72);
23808 __Pyx_GIVEREF(__pyx_tuple__72);
23809 __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 911, __pyx_L1_error)
23818 __pyx_tuple__74 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 924, __pyx_L1_error)
23819 __Pyx_GOTREF(__pyx_tuple__74);
23820 __Pyx_GIVEREF(__pyx_tuple__74);
23821 __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 924, __pyx_L1_error)
23822 __Pyx_RefNannyFinishContext();
23825 __Pyx_RefNannyFinishContext();
23829 static int __Pyx_InitGlobals(
void) {
23830 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23831 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23832 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
23833 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23834 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) __PYX_ERR(0, 1, __pyx_L1_error)
23840 #if PY_MAJOR_VERSION < 3 23848 PyObject *__pyx_t_1 = NULL;
23849 __Pyx_RefNannyDeclarations
23850 #if CYTHON_REFNANNY 23851 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23852 if (!__Pyx_RefNanny) {
23854 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23855 if (!__Pyx_RefNanny)
23856 Py_FatalError(
"failed to import 'refnanny' module");
23859 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
23860 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23861 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23862 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23863 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23864 #ifdef __Pyx_CyFunction_USED 23865 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23867 #ifdef __Pyx_FusedFunction_USED 23868 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23870 #ifdef __Pyx_Coroutine_USED 23871 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23873 #ifdef __Pyx_Generator_USED 23874 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23876 #ifdef __Pyx_StopAsyncIteration_USED 23877 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23881 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 23883 PyEval_InitThreads();
23887 #if PY_MAJOR_VERSION < 3 23888 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23890 __pyx_m = PyModule_Create(&__pyx_moduledef);
23892 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23893 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23894 Py_INCREF(__pyx_d);
23895 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23896 #if CYTHON_COMPILING_IN_PYPY 23897 Py_INCREF(__pyx_b);
23899 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23901 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23902 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 23903 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23905 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
23906 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23908 #if PY_MAJOR_VERSION >= 3 23910 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23911 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
23912 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23917 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23919 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23925 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
23926 #
if CYTHON_COMPILING_IN_PYPY
23927 sizeof(PyTypeObject),
23929 sizeof(PyHeapTypeObject),
23931 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
23932 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
23933 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
23934 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
23935 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
23936 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
23940 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 23941 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23949 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23950 __Pyx_GOTREF(__pyx_t_1);
23951 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23952 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23961 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
23962 __Pyx_GOTREF(__pyx_t_1);
23963 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
23964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23973 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
23974 __Pyx_GOTREF(__pyx_t_1);
23975 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
23976 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23985 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
23986 __Pyx_GOTREF(__pyx_t_1);
23987 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 43, __pyx_L1_error)
23988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23997 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23998 __Pyx_GOTREF(__pyx_t_1);
23999 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
24000 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24009 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
24010 __Pyx_GOTREF(__pyx_t_1);
24011 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
24012 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24021 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
24022 __Pyx_GOTREF(__pyx_t_1);
24023 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
24024 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24033 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
24034 __Pyx_GOTREF(__pyx_t_1);
24035 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
24036 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24045 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
24046 __Pyx_GOTREF(__pyx_t_1);
24047 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
24048 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24057 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
24058 __Pyx_GOTREF(__pyx_t_1);
24059 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
24060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24069 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
24070 __Pyx_GOTREF(__pyx_t_1);
24071 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
24072 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24081 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
24082 __Pyx_GOTREF(__pyx_t_1);
24083 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
24084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24093 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
24094 __Pyx_GOTREF(__pyx_t_1);
24095 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
24096 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24105 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
24106 __Pyx_GOTREF(__pyx_t_1);
24107 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
24108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24117 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
24118 __Pyx_GOTREF(__pyx_t_1);
24119 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
24120 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24129 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
24130 __Pyx_GOTREF(__pyx_t_1);
24131 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
24132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24141 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
24142 __Pyx_GOTREF(__pyx_t_1);
24143 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) __PYX_ERR(0, 359, __pyx_L1_error)
24144 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24153 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
24154 __Pyx_GOTREF(__pyx_t_1);
24155 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
24156 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24165 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
24166 __Pyx_GOTREF(__pyx_t_1);
24167 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
24168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24177 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
24178 __Pyx_GOTREF(__pyx_t_1);
24179 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
24180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24189 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
24190 __Pyx_GOTREF(__pyx_t_1);
24191 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) __PYX_ERR(0, 692, __pyx_L1_error)
24192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24201 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
24202 __Pyx_GOTREF(__pyx_t_1);
24203 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
24204 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24213 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L1_error)
24214 __Pyx_GOTREF(__pyx_t_1);
24215 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) __PYX_ERR(0, 732, __pyx_L1_error)
24216 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24225 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
24226 __Pyx_GOTREF(__pyx_t_1);
24227 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
24228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24237 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
24238 __Pyx_GOTREF(__pyx_t_1);
24239 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
24240 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24249 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
24250 __Pyx_GOTREF(__pyx_t_1);
24251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
24252 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24261 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
24262 __Pyx_GOTREF(__pyx_t_1);
24263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
24264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24273 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
24274 __Pyx_GOTREF(__pyx_t_1);
24275 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
24276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24285 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
24286 __Pyx_GOTREF(__pyx_t_1);
24287 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) __PYX_ERR(0, 911, __pyx_L1_error)
24288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24297 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
24298 __Pyx_GOTREF(__pyx_t_1);
24299 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) __PYX_ERR(0, 924, __pyx_L1_error)
24300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24307 __pyx_t_1 = PyDict_New();
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24308 __Pyx_GOTREF(__pyx_t_1);
24309 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
24310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24324 __Pyx_XDECREF(__pyx_t_1);
24327 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
24329 Py_DECREF(__pyx_m); __pyx_m = 0;
24330 }
else if (!PyErr_Occurred()) {
24331 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
24334 __Pyx_RefNannyFinishContext();
24335 #if PY_MAJOR_VERSION < 3 24344 #if CYTHON_REFNANNY 24345 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
24346 PyObject *m = NULL, *p = NULL;
24348 m = PyImport_ImportModule((
char *)modname);
24350 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
24352 r = PyLong_AsVoidPtr(p);
24356 return (__Pyx_RefNannyAPIStruct *)r;
24361 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
24362 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
24363 if (unlikely(!result)) {
24364 PyErr_Format(PyExc_NameError,
24365 #
if PY_MAJOR_VERSION >= 3
24366 "name '%U' is not defined", name);
24368 "name '%.200s' is not defined", PyString_AS_STRING(name));
24375 static void __Pyx_RaiseArgtupleInvalid(
24376 const char* func_name,
24378 Py_ssize_t num_min,
24379 Py_ssize_t num_max,
24380 Py_ssize_t num_found)
24382 Py_ssize_t num_expected;
24383 const char *more_or_less;
24384 if (num_found < num_min) {
24385 num_expected = num_min;
24386 more_or_less =
"at least";
24388 num_expected = num_max;
24389 more_or_less =
"at most";
24392 more_or_less =
"exactly";
24394 PyErr_Format(PyExc_TypeError,
24395 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24396 func_name, more_or_less, num_expected,
24397 (num_expected == 1) ?
"" :
"s", num_found);
24401 static void __Pyx_RaiseDoubleKeywordsError(
24402 const char* func_name,
24405 PyErr_Format(PyExc_TypeError,
24406 #
if PY_MAJOR_VERSION >= 3
24407 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
24409 "%s() got multiple values for keyword argument '%s'", func_name,
24410 PyString_AsString(kw_name));
24415 static int __Pyx_ParseOptionalKeywords(
24417 PyObject **argnames[],
24419 PyObject *values[],
24420 Py_ssize_t num_pos_args,
24421 const char* function_name)
24423 PyObject *key = 0, *value = 0;
24424 Py_ssize_t pos = 0;
24426 PyObject*** first_kw_arg = argnames + num_pos_args;
24427 while (PyDict_Next(kwds, &pos, &key, &value)) {
24428 name = first_kw_arg;
24429 while (*name && (**name != key)) name++;
24431 values[name-argnames] = value;
24434 name = first_kw_arg;
24435 #if PY_MAJOR_VERSION < 3 24436 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
24438 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
24439 && _PyString_Eq(**name, key)) {
24440 values[name-argnames] = value;
24445 if (*name)
continue;
24447 PyObject*** argname = argnames;
24448 while (argname != first_kw_arg) {
24449 if ((**argname == key) || (
24450 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
24451 && _PyString_Eq(**argname, key))) {
24452 goto arg_passed_twice;
24459 if (likely(PyUnicode_Check(key))) {
24461 int cmp = (**name == key) ? 0 :
24462 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24463 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
24465 PyUnicode_Compare(**name, key);
24466 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24468 values[name-argnames] = value;
24473 if (*name)
continue;
24475 PyObject*** argname = argnames;
24476 while (argname != first_kw_arg) {
24477 int cmp = (**argname == key) ? 0 :
24478 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
24479 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
24481 PyUnicode_Compare(**argname, key);
24482 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
24483 if (cmp == 0)
goto arg_passed_twice;
24488 goto invalid_keyword_type;
24490 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
24492 goto invalid_keyword;
24497 __Pyx_RaiseDoubleKeywordsError(function_name, key);
24499 invalid_keyword_type:
24500 PyErr_Format(PyExc_TypeError,
24501 "%.200s() keywords must be strings", function_name);
24504 PyErr_Format(PyExc_TypeError,
24505 #
if PY_MAJOR_VERSION < 3
24506 "%.200s() got an unexpected keyword argument '%.200s'",
24507 function_name, PyString_AsString(key));
24509 "%s() got an unexpected keyword argument '%U'",
24510 function_name, key);
24517 static void __Pyx_RaiseArgumentTypeInvalid(
const char* name, PyObject *obj, PyTypeObject *type) {
24518 PyErr_Format(PyExc_TypeError,
24519 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24520 name, type->tp_name, Py_TYPE(obj)->tp_name);
24522 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
24523 const char *name,
int exact)
24525 if (unlikely(!type)) {
24526 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24529 if (none_allowed && obj == Py_None)
return 1;
24531 if (likely(Py_TYPE(obj) == type))
return 1;
24532 #if PY_MAJOR_VERSION == 2 24533 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24537 if (likely(PyObject_TypeCheck(obj, type)))
return 1;
24539 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
24544 static CYTHON_INLINE
int __Pyx_IsLittleEndian(
void) {
24545 unsigned int n = 1;
24546 return *(
unsigned char*)(&n) != 0;
24548 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
24549 __Pyx_BufFmt_StackElem* stack,
24550 __Pyx_TypeInfo* type) {
24551 stack[0].field = &ctx->root;
24552 stack[0].parent_offset = 0;
24553 ctx->root.type = type;
24554 ctx->root.name =
"buffer dtype";
24555 ctx->root.offset = 0;
24557 ctx->head->field = &ctx->root;
24558 ctx->fmt_offset = 0;
24559 ctx->head->parent_offset = 0;
24560 ctx->new_packmode =
'@';
24561 ctx->enc_packmode =
'@';
24562 ctx->new_count = 1;
24563 ctx->enc_count = 0;
24565 ctx->is_complex = 0;
24566 ctx->is_valid_array = 0;
24567 ctx->struct_alignment = 0;
24568 while (type->typegroup ==
'S') {
24570 ctx->head->field = type->fields;
24571 ctx->head->parent_offset = 0;
24572 type = type->fields->type;
24575 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
24577 const char* t = *ts;
24578 if (*t < '0' || *t >
'9') {
24581 count = *t++ -
'0';
24582 while (*t >=
'0' && *t <
'9') {
24584 count += *t++ -
'0';
24590 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
24591 int number = __Pyx_BufFmt_ParseNumber(ts);
24593 PyErr_Format(PyExc_ValueError,\
24594 "Does not understand character buffer dtype format string ('%c')", **ts);
24597 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
24598 PyErr_Format(PyExc_ValueError,
24599 "Unexpected format string character: '%c'", ch);
24601 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
24603 case 'c':
return "'char'";
24604 case 'b':
return "'signed char'";
24605 case 'B':
return "'unsigned char'";
24606 case 'h':
return "'short'";
24607 case 'H':
return "'unsigned short'";
24608 case 'i':
return "'int'";
24609 case 'I':
return "'unsigned int'";
24610 case 'l':
return "'long'";
24611 case 'L':
return "'unsigned long'";
24612 case 'q':
return "'long long'";
24613 case 'Q':
return "'unsigned long long'";
24614 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
24615 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
24616 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
24617 case 'T':
return "a struct";
24618 case 'O':
return "Python object";
24619 case 'P':
return "a pointer";
24620 case 's':
case 'p':
return "a string";
24621 case 0:
return "end";
24622 default:
return "unparseable format string";
24625 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
24627 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24628 case 'h':
case 'H':
return 2;
24629 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
24630 case 'q':
case 'Q':
return 8;
24631 case 'f':
return (is_complex ? 8 : 4);
24632 case 'd':
return (is_complex ? 16 : 8);
24634 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
24637 case 'O':
case 'P':
return sizeof(
void*);
24639 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24643 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
24645 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24646 case 'h':
case 'H':
return sizeof(short);
24647 case 'i':
case 'I':
return sizeof(int);
24648 case 'l':
case 'L':
return sizeof(long);
24649 #ifdef HAVE_LONG_LONG 24650 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
24652 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
24653 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
24654 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
24655 case 'O':
case 'P':
return sizeof(
void*);
24657 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24662 typedef struct {
char c;
short x; } __Pyx_st_short;
24663 typedef struct {
char c;
int x; } __Pyx_st_int;
24664 typedef struct {
char c;
long x; } __Pyx_st_long;
24665 typedef struct {
char c;
float x; } __Pyx_st_float;
24666 typedef struct {
char c;
double x; } __Pyx_st_double;
24667 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
24668 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
24669 #ifdef HAVE_LONG_LONG 24670 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
24672 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
24674 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24675 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
24676 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
24677 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
24678 #ifdef HAVE_LONG_LONG 24679 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
24681 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
24682 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
24683 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
24684 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
24686 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24694 typedef struct {
short x;
char c; } __Pyx_pad_short;
24695 typedef struct {
int x;
char c; } __Pyx_pad_int;
24696 typedef struct {
long x;
char c; } __Pyx_pad_long;
24697 typedef struct {
float x;
char c; } __Pyx_pad_float;
24698 typedef struct {
double x;
char c; } __Pyx_pad_double;
24699 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
24700 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
24701 #ifdef HAVE_LONG_LONG 24702 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
24704 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
24706 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
24707 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
24708 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
24709 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
24710 #ifdef HAVE_LONG_LONG 24711 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
24713 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
24714 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
24715 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
24716 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
24718 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24722 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
24726 case 'b':
case 'h':
case 'i':
24727 case 'l':
case 'q':
case 's':
case 'p':
24729 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
24731 case 'f':
case 'd':
case 'g':
24732 return (is_complex ?
'C' :
'R');
24738 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
24743 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
24744 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
24745 const char* expected;
24747 if (ctx->head == NULL) {
24751 expected = ctx->head->field->type->name;
24754 PyErr_Format(PyExc_ValueError,
24755 "Buffer dtype mismatch, expected %s%s%s but got %s",
24756 quote, expected, quote,
24757 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
24759 __Pyx_StructField* field = ctx->head->field;
24760 __Pyx_StructField* parent = (ctx->head - 1)->field;
24761 PyErr_Format(PyExc_ValueError,
24762 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
24763 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
24764 parent->type->name, field->name);
24767 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
24769 size_t size, offset, arraysize = 1;
24770 if (ctx->enc_type == 0)
return 0;
24771 if (ctx->head->field->type->arraysize[0]) {
24773 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
24774 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
24776 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
24777 PyErr_Format(PyExc_ValueError,
24778 "Expected a dimension of size %zu, got %zu",
24779 ctx->head->field->type->arraysize[0], ctx->enc_count);
24783 if (!ctx->is_valid_array) {
24784 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
24785 ctx->head->field->type->ndim, ndim);
24788 for (i = 0; i < ctx->head->field->type->ndim; i++) {
24789 arraysize *= ctx->head->field->type->arraysize[i];
24791 ctx->is_valid_array = 0;
24792 ctx->enc_count = 1;
24794 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
24796 __Pyx_StructField* field = ctx->head->field;
24797 __Pyx_TypeInfo* type = field->type;
24798 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
24799 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
24801 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
24803 if (ctx->enc_packmode ==
'@') {
24804 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
24805 size_t align_mod_offset;
24806 if (align_at == 0)
return -1;
24807 align_mod_offset = ctx->fmt_offset % align_at;
24808 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
24809 if (ctx->struct_alignment == 0)
24810 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
24813 if (type->size != size || type->typegroup != group) {
24814 if (type->typegroup ==
'C' && type->fields != NULL) {
24815 size_t parent_offset = ctx->head->parent_offset + field->offset;
24817 ctx->head->field = type->fields;
24818 ctx->head->parent_offset = parent_offset;
24821 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
24823 __Pyx_BufFmt_RaiseExpected(ctx);
24827 offset = ctx->head->parent_offset + field->offset;
24828 if (ctx->fmt_offset != offset) {
24829 PyErr_Format(PyExc_ValueError,
24830 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
24831 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
24834 ctx->fmt_offset += size;
24836 ctx->fmt_offset += (arraysize - 1) * size;
24839 if (field == &ctx->root) {
24841 if (ctx->enc_count != 0) {
24842 __Pyx_BufFmt_RaiseExpected(ctx);
24847 ctx->head->field = ++field;
24848 if (field->type == NULL) {
24850 field = ctx->head->field;
24852 }
else if (field->type->typegroup ==
'S') {
24853 size_t parent_offset = ctx->head->parent_offset + field->offset;
24854 if (field->type->fields->type == NULL)
continue;
24855 field = field->type->fields;
24857 ctx->head->field = field;
24858 ctx->head->parent_offset = parent_offset;
24864 }
while (ctx->enc_count);
24866 ctx->is_complex = 0;
24869 static CYTHON_INLINE PyObject *
24870 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
24872 const char *ts = *tsp;
24874 int ndim = ctx->head->field->type->ndim;
24877 if (ctx->new_count != 1) {
24878 PyErr_SetString(PyExc_ValueError,
24879 "Cannot handle repeated arrays in format string");
24882 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24883 while (*ts && *ts !=
')') {
24885 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
24888 number = __Pyx_BufFmt_ExpectNumber(&ts);
24889 if (number == -1)
return NULL;
24890 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
24891 return PyErr_Format(PyExc_ValueError,
24892 "Expected a dimension of size %zu, got %d",
24893 ctx->head->field->type->arraysize[i], number);
24894 if (*ts !=
',' && *ts !=
')')
24895 return PyErr_Format(PyExc_ValueError,
24896 "Expected a comma in format string, got '%c'", *ts);
24897 if (*ts ==
',') ts++;
24901 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
24902 ctx->head->field->type->ndim, i);
24904 PyErr_SetString(PyExc_ValueError,
24905 "Unexpected end of format string, expected ')'");
24908 ctx->is_valid_array = 1;
24909 ctx->new_count = 1;
24913 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
24918 if (ctx->enc_type != 0 && ctx->head == NULL) {
24919 __Pyx_BufFmt_RaiseExpected(ctx);
24922 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24923 if (ctx->head != NULL) {
24924 __Pyx_BufFmt_RaiseExpected(ctx);
24934 if (!__Pyx_IsLittleEndian()) {
24935 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
24938 ctx->new_packmode =
'=';
24943 if (__Pyx_IsLittleEndian()) {
24944 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
24947 ctx->new_packmode =
'=';
24953 ctx->new_packmode = *ts++;
24957 const char* ts_after_sub;
24958 size_t i, struct_count = ctx->new_count;
24959 size_t struct_alignment = ctx->struct_alignment;
24960 ctx->new_count = 1;
24963 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
24966 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24968 ctx->enc_count = 0;
24969 ctx->struct_alignment = 0;
24972 for (i = 0; i != struct_count; ++i) {
24973 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
24974 if (!ts_after_sub)
return NULL;
24977 if (struct_alignment) ctx->struct_alignment = struct_alignment;
24982 size_t alignment = ctx->struct_alignment;
24984 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24986 if (alignment && ctx->fmt_offset % alignment) {
24987 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
24992 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
24993 ctx->fmt_offset += ctx->new_count;
24994 ctx->new_count = 1;
24995 ctx->enc_count = 0;
24997 ctx->enc_packmode = ctx->new_packmode;
25003 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
25004 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
25007 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
25008 case 'l':
case 'L':
case 'q':
case 'Q':
25009 case 'f':
case 'd':
case 'g':
25010 case 'O':
case 'p':
25011 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
25012 ctx->enc_packmode == ctx->new_packmode) {
25013 ctx->enc_count += ctx->new_count;
25014 ctx->new_count = 1;
25020 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
25021 ctx->enc_count = ctx->new_count;
25022 ctx->enc_packmode = ctx->new_packmode;
25023 ctx->enc_type = *ts;
25024 ctx->is_complex = got_Z;
25026 ctx->new_count = 1;
25031 while(*ts !=
':') ++ts;
25035 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
25039 int number = __Pyx_BufFmt_ExpectNumber(&ts);
25040 if (number == -1)
return NULL;
25041 ctx->new_count = (size_t)number;
25046 static CYTHON_INLINE
void __Pyx_ZeroBuffer(Py_buffer* buf) {
25049 buf->strides = __Pyx_zeros;
25050 buf->shape = __Pyx_zeros;
25051 buf->suboffsets = __Pyx_minusones;
25053 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(
25054 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
25055 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
25057 if (obj == Py_None || obj == NULL) {
25058 __Pyx_ZeroBuffer(buf);
25062 if (__Pyx_GetBuffer(obj, buf, flags) == -1)
goto fail;
25063 if (buf->ndim != nd) {
25064 PyErr_Format(PyExc_ValueError,
25065 "Buffer has wrong number of dimensions (expected %d, got %d)",
25070 __Pyx_BufFmt_Context ctx;
25071 __Pyx_BufFmt_Init(&ctx, stack, dtype);
25072 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
25074 if ((
unsigned)buf->itemsize != dtype->size) {
25075 PyErr_Format(PyExc_ValueError,
25076 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
25077 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
25078 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
25081 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
25084 __Pyx_ZeroBuffer(buf);
25087 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
25088 if (info->buf == NULL)
return;
25089 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
25090 __Pyx_ReleaseBuffer(info);
25094 static void __Pyx_RaiseBufferIndexError(
int axis) {
25095 PyErr_Format(PyExc_IndexError,
25096 "Out of bounds on buffer access (axis %d)", axis);
25100 #if CYTHON_FAST_THREAD_STATE 25101 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25102 PyObject *tmp_type, *tmp_value, *tmp_tb;
25103 tmp_type = tstate->curexc_type;
25104 tmp_value = tstate->curexc_value;
25105 tmp_tb = tstate->curexc_traceback;
25106 tstate->curexc_type = type;
25107 tstate->curexc_value = value;
25108 tstate->curexc_traceback = tb;
25109 Py_XDECREF(tmp_type);
25110 Py_XDECREF(tmp_value);
25111 Py_XDECREF(tmp_tb);
25113 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25114 *type = tstate->curexc_type;
25115 *value = tstate->curexc_value;
25116 *tb = tstate->curexc_traceback;
25117 tstate->curexc_type = 0;
25118 tstate->curexc_value = 0;
25119 tstate->curexc_traceback = 0;
25124 #if !CYTHON_COMPILING_IN_PYPY 25125 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
25126 const double b = floatval;
25128 if (likely(PyFloat_CheckExact(op1))) {
25129 a = PyFloat_AS_DOUBLE(op1);
25131 #if PY_MAJOR_VERSION < 3 25132 if (likely(PyInt_CheckExact(op1))) {
25133 a = (double) PyInt_AS_LONG(op1);
25136 if (likely(PyLong_CheckExact(op1))) {
25137 #if CYTHON_USE_PYLONG_INTERNALS 25138 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25139 const Py_ssize_t size = Py_SIZE(op1);
25141 case 0: a = 0.0;
break;
25142 case -1: a = -(double) digits[0];
break;
25143 case 1: a = (double) digits[0];
break;
25146 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
25147 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25148 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
25156 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
25157 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25158 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
25166 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
25167 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25168 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
25178 a = PyLong_AsDouble(op1);
25179 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
25182 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25184 PyFPE_START_PROTECT(
"add",
return NULL)
25186 PyFPE_END_PROTECT(result)
25187 return PyFloat_FromDouble(result);
25192 #if CYTHON_FAST_PYCALL 25193 #include "frameobject.h" 25194 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
25195 PyObject *globals) {
25197 PyThreadState *tstate = PyThreadState_GET();
25198 PyObject **fastlocals;
25201 assert(globals != NULL);
25206 assert(tstate != NULL);
25207 f = PyFrame_New(tstate, co, globals, NULL);
25211 fastlocals = f->f_localsplus;
25212 for (i = 0; i < na; i++) {
25214 fastlocals[i] = *args++;
25216 result = PyEval_EvalFrameEx(f,0);
25217 ++tstate->recursion_depth;
25219 --tstate->recursion_depth;
25222 #if 1 || PY_VERSION_HEX < 0x030600B1 25223 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
25224 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
25225 PyObject *globals = PyFunction_GET_GLOBALS(func);
25226 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
25228 #if PY_MAJOR_VERSION >= 3 25231 PyObject *kwtuple, **k;
25236 assert(kwargs == NULL || PyDict_Check(kwargs));
25237 nk = kwargs ? PyDict_Size(kwargs) : 0;
25238 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
25242 #
if PY_MAJOR_VERSION >= 3
25243 co->co_kwonlyargcount == 0 &&
25245 likely(kwargs == NULL || nk == 0) &&
25246 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
25247 if (argdefs == NULL && co->co_argcount == nargs) {
25248 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
25251 else if (nargs == 0 && argdefs != NULL
25252 && co->co_argcount == Py_SIZE(argdefs)) {
25255 args = &PyTuple_GET_ITEM(argdefs, 0);
25256 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
25260 if (kwargs != NULL) {
25262 kwtuple = PyTuple_New(2 * nk);
25263 if (kwtuple == NULL) {
25267 k = &PyTuple_GET_ITEM(kwtuple, 0);
25269 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
25280 closure = PyFunction_GET_CLOSURE(func);
25281 #if PY_MAJOR_VERSION >= 3 25282 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
25284 if (argdefs != NULL) {
25285 d = &PyTuple_GET_ITEM(argdefs, 0);
25286 nd = Py_SIZE(argdefs);
25292 #if PY_MAJOR_VERSION >= 3 25293 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
25296 d, (
int)nd, kwdefs, closure);
25298 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
25301 d, (
int)nd, closure);
25303 Py_XDECREF(kwtuple);
25305 Py_LeaveRecursiveCall();
25308 #endif // CPython < 3.6 25309 #endif // CYTHON_FAST_PYCALL 25312 #if CYTHON_FAST_PYCCALL 25313 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
25314 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
25315 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
25316 PyObject *
self = PyCFunction_GET_SELF(func);
25317 assert(PyCFunction_Check(func));
25318 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
25319 assert(nargs >= 0);
25320 assert(nargs == 0 || args != NULL);
25324 assert(!PyErr_Occurred());
25325 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs, NULL);
25327 #endif // CYTHON_FAST_PYCCALL 25330 #if CYTHON_COMPILING_IN_CPYTHON 25331 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25333 ternaryfunc call = func->ob_type->tp_call;
25334 if (unlikely(!call))
25335 return PyObject_Call(func, arg, kw);
25336 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25338 result = (*call)(func, arg, kw);
25339 Py_LeaveRecursiveCall();
25340 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25343 "NULL result without error in PyObject_Call");
25350 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
25352 #if !CYTHON_AVOID_BORROWED_REFS 25353 result = PyDict_GetItem(__pyx_d, name);
25354 if (likely(result)) {
25358 result = PyObject_GetItem(__pyx_d, name);
25362 result = __Pyx_GetBuiltinName(name);
25368 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25369 if (unlikely(!type)) {
25370 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25373 if (likely(PyObject_TypeCheck(obj, type)))
25375 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25376 Py_TYPE(obj)->tp_name, type->tp_name);
25381 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
25383 if (!j)
return NULL;
25384 r = PyObject_GetItem(o, j);
25388 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
25389 CYTHON_NCP_UNUSED
int wraparound,
25390 CYTHON_NCP_UNUSED
int boundscheck) {
25391 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25392 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
25393 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
25394 PyObject *r = PyList_GET_ITEM(o, i);
25398 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25400 return PySequence_GetItem(o, i);
25403 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
25404 CYTHON_NCP_UNUSED
int wraparound,
25405 CYTHON_NCP_UNUSED
int boundscheck) {
25406 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 25407 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
25408 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
25409 PyObject *r = PyTuple_GET_ITEM(o, i);
25413 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25415 return PySequence_GetItem(o, i);
25418 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
25419 CYTHON_NCP_UNUSED
int wraparound,
25420 CYTHON_NCP_UNUSED
int boundscheck) {
25421 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS 25422 if (is_list || PyList_CheckExact(o)) {
25423 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
25424 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
25425 PyObject *r = PyList_GET_ITEM(o, n);
25430 else if (PyTuple_CheckExact(o)) {
25431 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
25432 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
25433 PyObject *r = PyTuple_GET_ITEM(o, n);
25438 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
25439 if (likely(m && m->sq_item)) {
25440 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
25441 Py_ssize_t l = m->sq_length(o);
25442 if (likely(l >= 0)) {
25445 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25450 return m->sq_item(o, i);
25454 if (is_list || PySequence_Check(o)) {
25455 return PySequence_GetItem(o, i);
25458 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
25462 #if CYTHON_COMPILING_IN_CPYTHON 25463 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
25464 PyObject *
self, *result;
25466 cfunc = PyCFunction_GET_FUNCTION(func);
25467 self = PyCFunction_GET_SELF(func);
25468 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
25470 result = cfunc(
self, arg);
25471 Py_LeaveRecursiveCall();
25472 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
25475 "NULL result without error in PyObject_Call");
25482 #if CYTHON_COMPILING_IN_CPYTHON 25483 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25485 PyObject *args = PyTuple_New(1);
25486 if (unlikely(!args))
return NULL;
25488 PyTuple_SET_ITEM(args, 0, arg);
25489 result = __Pyx_PyObject_Call(func, args, NULL);
25493 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25494 #if CYTHON_FAST_PYCALL 25495 if (PyFunction_Check(func)) {
25496 return __Pyx_PyFunction_FastCall(func, &arg, 1);
25499 #ifdef __Pyx_CyFunction_USED 25500 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
25502 if (likely(PyCFunction_Check(func))) {
25504 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
25505 return __Pyx_PyObject_CallMethO(func, arg);
25506 #if CYTHON_FAST_PYCCALL 25507 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
25508 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
25512 return __Pyx__PyObject_CallOneArg(func, arg);
25515 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
25517 PyObject *args = PyTuple_Pack(1, arg);
25518 if (unlikely(!args))
return NULL;
25519 result = __Pyx_PyObject_Call(func, args, NULL);
25526 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
25527 PyObject* float_value;
25528 #if !CYTHON_USE_TYPE_SLOTS 25529 float_value = PyNumber_Float(obj);
if (0)
goto bad;
25531 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
25532 if (likely(nb) && likely(nb->nb_float)) {
25533 float_value = nb->nb_float(obj);
25534 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
25535 PyErr_Format(PyExc_TypeError,
25536 "__float__ returned non-float (type %.200s)",
25537 Py_TYPE(float_value)->tp_name);
25538 Py_DECREF(float_value);
25541 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
25542 #if PY_MAJOR_VERSION >= 3 25543 float_value = PyFloat_FromString(obj);
25545 float_value = PyFloat_FromString(obj, 0);
25548 PyObject* args = PyTuple_New(1);
25549 if (unlikely(!args))
goto bad;
25550 PyTuple_SET_ITEM(args, 0, obj);
25551 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
25552 PyTuple_SET_ITEM(args, 0, 0);
25556 if (likely(float_value)) {
25557 double value = PyFloat_AS_DOUBLE(float_value);
25558 Py_DECREF(float_value);
25566 #if PY_MAJOR_VERSION < 3 25567 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25568 CYTHON_UNUSED PyObject *cause) {
25569 __Pyx_PyThreadState_declare
25571 if (!value || value == Py_None)
25575 if (!tb || tb == Py_None)
25579 if (!PyTraceBack_Check(tb)) {
25580 PyErr_SetString(PyExc_TypeError,
25581 "raise: arg 3 must be a traceback or None");
25585 if (PyType_Check(type)) {
25586 #if CYTHON_COMPILING_IN_PYPY 25588 Py_INCREF(Py_None);
25592 PyErr_NormalizeException(&type, &value, &tb);
25595 PyErr_SetString(PyExc_TypeError,
25596 "instance exception may not have a separate value");
25600 type = (PyObject*) Py_TYPE(type);
25602 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25603 PyErr_SetString(PyExc_TypeError,
25604 "raise: exception class must be a subclass of BaseException");
25608 __Pyx_PyThreadState_assign
25609 __Pyx_ErrRestore(type, value, tb);
25618 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25619 PyObject* owned_instance = NULL;
25620 if (tb == Py_None) {
25622 }
else if (tb && !PyTraceBack_Check(tb)) {
25623 PyErr_SetString(PyExc_TypeError,
25624 "raise: arg 3 must be a traceback or None");
25627 if (value == Py_None)
25629 if (PyExceptionInstance_Check(type)) {
25631 PyErr_SetString(PyExc_TypeError,
25632 "instance exception may not have a separate value");
25636 type = (PyObject*) Py_TYPE(value);
25637 }
else if (PyExceptionClass_Check(type)) {
25638 PyObject *instance_class = NULL;
25639 if (value && PyExceptionInstance_Check(value)) {
25640 instance_class = (PyObject*) Py_TYPE(value);
25641 if (instance_class != type) {
25642 int is_subclass = PyObject_IsSubclass(instance_class, type);
25643 if (!is_subclass) {
25644 instance_class = NULL;
25645 }
else if (unlikely(is_subclass == -1)) {
25648 type = instance_class;
25652 if (!instance_class) {
25655 args = PyTuple_New(0);
25656 else if (PyTuple_Check(value)) {
25660 args = PyTuple_Pack(1, value);
25663 owned_instance = PyObject_Call(type, args, NULL);
25665 if (!owned_instance)
25667 value = owned_instance;
25668 if (!PyExceptionInstance_Check(value)) {
25669 PyErr_Format(PyExc_TypeError,
25670 "calling %R should have returned an instance of " 25671 "BaseException, not %R",
25672 type, Py_TYPE(value));
25677 PyErr_SetString(PyExc_TypeError,
25678 "raise: exception class must be a subclass of BaseException");
25681 #if PY_VERSION_HEX >= 0x03030000 25684 if (cause && cause != Py_None) {
25686 PyObject *fixed_cause;
25687 if (cause == Py_None) {
25688 fixed_cause = NULL;
25689 }
else if (PyExceptionClass_Check(cause)) {
25690 fixed_cause = PyObject_CallObject(cause, NULL);
25691 if (fixed_cause == NULL)
25693 }
else if (PyExceptionInstance_Check(cause)) {
25694 fixed_cause = cause;
25695 Py_INCREF(fixed_cause);
25697 PyErr_SetString(PyExc_TypeError,
25698 "exception causes must derive from " 25702 PyException_SetCause(value, fixed_cause);
25704 PyErr_SetObject(type, value);
25706 #if CYTHON_COMPILING_IN_PYPY 25707 PyObject *tmp_type, *tmp_value, *tmp_tb;
25708 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25710 PyErr_Restore(tmp_type, tmp_value, tb);
25711 Py_XDECREF(tmp_tb);
25713 PyThreadState *tstate = PyThreadState_GET();
25714 PyObject* tmp_tb = tstate->curexc_traceback;
25715 if (tb != tmp_tb) {
25717 tstate->curexc_traceback = tb;
25718 Py_XDECREF(tmp_tb);
25723 Py_XDECREF(owned_instance);
25729 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25730 PyErr_Format(PyExc_ValueError,
25731 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25735 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25736 PyErr_Format(PyExc_ValueError,
25737 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25738 index, (index == 1) ?
"" :
"s");
25742 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25743 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25747 #if CYTHON_FAST_THREAD_STATE 25748 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25749 *type = tstate->exc_type;
25750 *value = tstate->exc_value;
25751 *tb = tstate->exc_traceback;
25753 Py_XINCREF(*value);
25756 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25757 PyObject *tmp_type, *tmp_value, *tmp_tb;
25758 tmp_type = tstate->exc_type;
25759 tmp_value = tstate->exc_value;
25760 tmp_tb = tstate->exc_traceback;
25761 tstate->exc_type = type;
25762 tstate->exc_value = value;
25763 tstate->exc_traceback = tb;
25764 Py_XDECREF(tmp_type);
25765 Py_XDECREF(tmp_value);
25766 Py_XDECREF(tmp_tb);
25771 #if CYTHON_FAST_THREAD_STATE 25772 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
25773 PyObject *exc_type = tstate->curexc_type;
25774 if (exc_type == err)
return 1;
25775 if (unlikely(!exc_type))
return 0;
25776 return PyErr_GivenExceptionMatches(exc_type, err);
25781 #if CYTHON_FAST_THREAD_STATE 25782 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25784 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25786 PyObject *local_type, *local_value, *local_tb;
25787 #if CYTHON_FAST_THREAD_STATE 25788 PyObject *tmp_type, *tmp_value, *tmp_tb;
25789 local_type = tstate->curexc_type;
25790 local_value = tstate->curexc_value;
25791 local_tb = tstate->curexc_traceback;
25792 tstate->curexc_type = 0;
25793 tstate->curexc_value = 0;
25794 tstate->curexc_traceback = 0;
25796 PyErr_Fetch(&local_type, &local_value, &local_tb);
25798 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25799 #if CYTHON_FAST_THREAD_STATE 25800 if (unlikely(tstate->curexc_type))
25802 if (unlikely(PyErr_Occurred()))
25805 #if PY_MAJOR_VERSION >= 3 25807 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25811 Py_XINCREF(local_tb);
25812 Py_XINCREF(local_type);
25813 Py_XINCREF(local_value);
25814 *type = local_type;
25815 *value = local_value;
25817 #if CYTHON_FAST_THREAD_STATE 25818 tmp_type = tstate->exc_type;
25819 tmp_value = tstate->exc_value;
25820 tmp_tb = tstate->exc_traceback;
25821 tstate->exc_type = local_type;
25822 tstate->exc_value = local_value;
25823 tstate->exc_traceback = local_tb;
25824 Py_XDECREF(tmp_type);
25825 Py_XDECREF(tmp_value);
25826 Py_XDECREF(tmp_tb);
25828 PyErr_SetExcInfo(local_type, local_value, local_tb);
25835 Py_XDECREF(local_type);
25836 Py_XDECREF(local_value);
25837 Py_XDECREF(local_tb);
25842 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25843 PyObject *empty_list = 0;
25844 PyObject *module = 0;
25845 PyObject *global_dict = 0;
25846 PyObject *empty_dict = 0;
25848 #if PY_VERSION_HEX < 0x03030000 25849 PyObject *py_import;
25850 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25857 empty_list = PyList_New(0);
25862 global_dict = PyModule_GetDict(__pyx_m);
25865 empty_dict = PyDict_New();
25869 #if PY_MAJOR_VERSION >= 3 25871 if (strchr(__Pyx_MODULE_NAME,
'.')) {
25872 #if PY_VERSION_HEX < 0x03030000 25873 PyObject *py_level = PyInt_FromLong(1);
25876 module = PyObject_CallFunctionObjArgs(py_import,
25877 name, global_dict, empty_dict, list, py_level, NULL);
25878 Py_DECREF(py_level);
25880 module = PyImport_ImportModuleLevelObject(
25881 name, global_dict, empty_dict, list, 1);
25884 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25893 #if PY_VERSION_HEX < 0x03030000 25894 PyObject *py_level = PyInt_FromLong(level);
25897 module = PyObject_CallFunctionObjArgs(py_import,
25898 name, global_dict, empty_dict, list, py_level, NULL);
25899 Py_DECREF(py_level);
25901 module = PyImport_ImportModuleLevelObject(
25902 name, global_dict, empty_dict, list, level);
25907 #if PY_VERSION_HEX < 0x03030000 25908 Py_XDECREF(py_import);
25910 Py_XDECREF(empty_list);
25911 Py_XDECREF(empty_dict);
25916 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
25917 int start = 0, mid = 0, end = count - 1;
25918 if (end >= 0 && code_line > entries[end].code_line) {
25921 while (start < end) {
25922 mid = start + (end - start) / 2;
25923 if (code_line < entries[mid].code_line) {
25925 }
else if (code_line > entries[mid].code_line) {
25931 if (code_line <= entries[mid].code_line) {
25937 static PyCodeObject *__pyx_find_code_object(
int code_line) {
25938 PyCodeObject* code_object;
25940 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25943 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25944 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25947 code_object = __pyx_code_cache.entries[pos].code_object;
25948 Py_INCREF(code_object);
25949 return code_object;
25951 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
25953 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25954 if (unlikely(!code_line)) {
25957 if (unlikely(!entries)) {
25958 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
25959 if (likely(entries)) {
25960 __pyx_code_cache.entries = entries;
25961 __pyx_code_cache.max_count = 64;
25962 __pyx_code_cache.count = 1;
25963 entries[0].code_line = code_line;
25964 entries[0].code_object = code_object;
25965 Py_INCREF(code_object);
25969 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25970 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
25971 PyCodeObject* tmp = entries[pos].code_object;
25972 entries[pos].code_object = code_object;
25976 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
25977 int new_max = __pyx_code_cache.max_count + 64;
25978 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
25979 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
25980 if (unlikely(!entries)) {
25983 __pyx_code_cache.entries = entries;
25984 __pyx_code_cache.max_count = new_max;
25986 for (i=__pyx_code_cache.count; i>pos; i--) {
25987 entries[i] = entries[i-1];
25989 entries[pos].code_line = code_line;
25990 entries[pos].code_object = code_object;
25991 __pyx_code_cache.count++;
25992 Py_INCREF(code_object);
25996 #include "compile.h" 25997 #include "frameobject.h" 25998 #include "traceback.h" 25999 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26000 const char *funcname,
int c_line,
26001 int py_line,
const char *filename) {
26002 PyCodeObject *py_code = 0;
26003 PyObject *py_srcfile = 0;
26004 PyObject *py_funcname = 0;
26005 #if PY_MAJOR_VERSION < 3 26006 py_srcfile = PyString_FromString(filename);
26008 py_srcfile = PyUnicode_FromString(filename);
26010 if (!py_srcfile)
goto bad;
26012 #if PY_MAJOR_VERSION < 3 26013 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26015 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26019 #if PY_MAJOR_VERSION < 3 26020 py_funcname = PyString_FromString(funcname);
26022 py_funcname = PyUnicode_FromString(funcname);
26025 if (!py_funcname)
goto bad;
26026 py_code = __Pyx_PyCode_New(
26043 Py_DECREF(py_srcfile);
26044 Py_DECREF(py_funcname);
26047 Py_XDECREF(py_srcfile);
26048 Py_XDECREF(py_funcname);
26051 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26052 int py_line,
const char *filename) {
26053 PyCodeObject *py_code = 0;
26054 PyFrameObject *py_frame = 0;
26055 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
26057 py_code = __Pyx_CreateCodeObjectForTraceback(
26058 funcname, c_line, py_line, filename);
26059 if (!py_code)
goto bad;
26060 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
26062 py_frame = PyFrame_New(
26063 PyThreadState_GET(),
26068 if (!py_frame)
goto bad;
26069 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26070 PyTraceBack_Here(py_frame);
26072 Py_XDECREF(py_code);
26073 Py_XDECREF(py_frame);
26076 #if PY_MAJOR_VERSION < 3 26077 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26078 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26079 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26080 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26083 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26084 PyObject *obj = view->obj;
26086 if (PyObject_CheckBuffer(obj)) {
26087 PyBuffer_Release(view);
26090 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
return; }
26098 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 26099 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 26100 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 26101 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 26102 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 26104 func_type value = func_value;\ 26105 if (sizeof(target_type) < sizeof(func_type)) {\ 26106 if (unlikely(value != (func_type) (target_type) value)) {\ 26107 func_type zero = 0;\ 26108 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 26109 return (target_type) -1;\ 26110 if (is_unsigned && unlikely(value < zero))\ 26111 goto raise_neg_overflow;\ 26113 goto raise_overflow;\ 26116 return (target_type) value;\ 26120 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
26121 const int neg_one = (int) -1, const_zero = (
int) 0;
26122 const int is_unsigned = neg_one > const_zero;
26124 if (
sizeof(
int) <
sizeof(long)) {
26125 return PyInt_FromLong((
long) value);
26126 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26127 return PyLong_FromUnsignedLong((
unsigned long) value);
26128 #ifdef HAVE_LONG_LONG 26129 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26130 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26134 if (
sizeof(
int) <=
sizeof(
long)) {
26135 return PyInt_FromLong((
long) value);
26136 #ifdef HAVE_LONG_LONG 26137 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26138 return PyLong_FromLongLong((PY_LONG_LONG) value);
26143 int one = 1;
int little = (int)*(
unsigned char *)&one;
26144 unsigned char *bytes = (
unsigned char *)&value;
26145 return _PyLong_FromByteArray(bytes,
sizeof(
int),
26146 little, !is_unsigned);
26151 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
26152 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26153 const int is_unsigned = neg_one > const_zero;
26155 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26156 return PyInt_FromLong((
long) value);
26157 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26158 return PyLong_FromUnsignedLong((
unsigned long) value);
26159 #ifdef HAVE_LONG_LONG 26160 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26161 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26165 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
26166 return PyInt_FromLong((
long) value);
26167 #ifdef HAVE_LONG_LONG 26168 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26169 return PyLong_FromLongLong((PY_LONG_LONG) value);
26174 int one = 1;
int little = (int)*(
unsigned char *)&one;
26175 unsigned char *bytes = (
unsigned char *)&value;
26176 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
26177 little, !is_unsigned);
26182 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
26183 const long neg_one = (long) -1, const_zero = (
long) 0;
26184 const int is_unsigned = neg_one > const_zero;
26186 if (
sizeof(
long) <
sizeof(long)) {
26187 return PyInt_FromLong((
long) value);
26188 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26189 return PyLong_FromUnsignedLong((
unsigned long) value);
26190 #ifdef HAVE_LONG_LONG 26191 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
26192 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26196 if (
sizeof(
long) <=
sizeof(
long)) {
26197 return PyInt_FromLong((
long) value);
26198 #ifdef HAVE_LONG_LONG 26199 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
26200 return PyLong_FromLongLong((PY_LONG_LONG) value);
26205 int one = 1;
int little = (int)*(
unsigned char *)&one;
26206 unsigned char *bytes = (
unsigned char *)&value;
26207 return _PyLong_FromByteArray(bytes,
sizeof(
long),
26208 little, !is_unsigned);
26213 #if CYTHON_CCOMPLEX 26215 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26216 return ::std::complex< float >(x, y);
26219 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26220 return x + y*(__pyx_t_float_complex)_Complex_I;
26224 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
26225 __pyx_t_float_complex z;
26233 #if CYTHON_CCOMPLEX 26235 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26236 return (a.real == b.real) && (a.imag == b.imag);
26238 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26239 __pyx_t_float_complex z;
26240 z.real = a.real + b.real;
26241 z.imag = a.imag + b.imag;
26244 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26245 __pyx_t_float_complex z;
26246 z.real = a.real - b.real;
26247 z.imag = a.imag - b.imag;
26250 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26251 __pyx_t_float_complex z;
26252 z.real = a.real * b.real - a.imag * b.imag;
26253 z.imag = a.real * b.imag + a.imag * b.real;
26257 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26259 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26260 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
26261 if (b.real == 0 && b.imag == 0) {
26262 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
26264 float r = b.imag / b.real;
26265 float s = 1.0 / (b.real + b.imag * r);
26266 return __pyx_t_float_complex_from_parts(
26267 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26270 float r = b.real / b.imag;
26271 float s = 1.0 / (b.imag + b.real * r);
26272 return __pyx_t_float_complex_from_parts(
26273 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26277 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26279 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
26281 float denom = b.real * b.real + b.imag * b.imag;
26282 return __pyx_t_float_complex_from_parts(
26283 (a.real * b.real + a.imag * b.imag) / denom,
26284 (a.imag * b.real - a.real * b.imag) / denom);
26288 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
26289 __pyx_t_float_complex z;
26294 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
26295 return (a.real == 0) && (a.imag == 0);
26297 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
26298 __pyx_t_float_complex z;
26304 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex z) {
26305 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 26306 return sqrtf(z.real*z.real + z.imag*z.imag);
26308 return hypotf(z.real, z.imag);
26311 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
26312 __pyx_t_float_complex z;
26313 float r, lnr, theta, z_r, z_theta;
26314 if (b.imag == 0 && b.real == (
int)b.real) {
26316 float denom = a.real * a.real + a.imag * a.imag;
26317 a.real = a.real / denom;
26318 a.imag = -a.imag / denom;
26321 switch ((
int)b.real) {
26329 z = __Pyx_c_prod_float(a, a);
26330 return __Pyx_c_prod_float(a, a);
26332 z = __Pyx_c_prod_float(a, a);
26333 return __Pyx_c_prod_float(z, a);
26335 z = __Pyx_c_prod_float(a, a);
26336 return __Pyx_c_prod_float(z, z);
26342 }
else if (b.imag == 0) {
26343 z.real = powf(a.real, b.real);
26346 }
else if (a.real > 0) {
26351 theta = atan2f(0, -1);
26354 r = __Pyx_c_abs_float(a);
26355 theta = atan2f(a.imag, a.real);
26358 z_r = expf(lnr * b.real - theta * b.imag);
26359 z_theta = theta * b.real + lnr * b.imag;
26360 z.real = z_r * cosf(z_theta);
26361 z.imag = z_r * sinf(z_theta);
26368 #if CYTHON_CCOMPLEX 26370 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26371 return ::std::complex< double >(x, y);
26374 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26375 return x + y*(__pyx_t_double_complex)_Complex_I;
26379 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
26380 __pyx_t_double_complex z;
26388 #if CYTHON_CCOMPLEX 26390 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26391 return (a.real == b.real) && (a.imag == b.imag);
26393 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26394 __pyx_t_double_complex z;
26395 z.real = a.real + b.real;
26396 z.imag = a.imag + b.imag;
26399 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26400 __pyx_t_double_complex z;
26401 z.real = a.real - b.real;
26402 z.imag = a.imag - b.imag;
26405 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26406 __pyx_t_double_complex z;
26407 z.real = a.real * b.real - a.imag * b.imag;
26408 z.imag = a.real * b.imag + a.imag * b.real;
26412 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26414 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26415 }
else if (fabs(b.real) >= fabs(b.imag)) {
26416 if (b.real == 0 && b.imag == 0) {
26417 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
26419 double r = b.imag / b.real;
26420 double s = 1.0 / (b.real + b.imag * r);
26421 return __pyx_t_double_complex_from_parts(
26422 (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
26425 double r = b.real / b.imag;
26426 double s = 1.0 / (b.imag + b.real * r);
26427 return __pyx_t_double_complex_from_parts(
26428 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
26432 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26434 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
26436 double denom = b.real * b.real + b.imag * b.imag;
26437 return __pyx_t_double_complex_from_parts(
26438 (a.real * b.real + a.imag * b.imag) / denom,
26439 (a.imag * b.real - a.real * b.imag) / denom);
26443 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
26444 __pyx_t_double_complex z;
26449 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
26450 return (a.real == 0) && (a.imag == 0);
26452 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
26453 __pyx_t_double_complex z;
26459 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex z) {
26460 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) 26461 return sqrt(z.real*z.real + z.imag*z.imag);
26463 return hypot(z.real, z.imag);
26466 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
26467 __pyx_t_double_complex z;
26468 double r, lnr, theta, z_r, z_theta;
26469 if (b.imag == 0 && b.real == (
int)b.real) {
26471 double denom = a.real * a.real + a.imag * a.imag;
26472 a.real = a.real / denom;
26473 a.imag = -a.imag / denom;
26476 switch ((
int)b.real) {
26484 z = __Pyx_c_prod_double(a, a);
26485 return __Pyx_c_prod_double(a, a);
26487 z = __Pyx_c_prod_double(a, a);
26488 return __Pyx_c_prod_double(z, a);
26490 z = __Pyx_c_prod_double(a, a);
26491 return __Pyx_c_prod_double(z, z);
26497 }
else if (b.imag == 0) {
26498 z.real = pow(a.real, b.real);
26501 }
else if (a.real > 0) {
26506 theta = atan2(0, -1);
26509 r = __Pyx_c_abs_double(a);
26510 theta = atan2(a.imag, a.real);
26513 z_r = exp(lnr * b.real - theta * b.imag);
26514 z_theta = theta * b.real + lnr * b.imag;
26515 z.real = z_r * cos(z_theta);
26516 z.imag = z_r * sin(z_theta);
26523 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
26524 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
26525 const int is_unsigned = neg_one > const_zero;
26527 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
26528 return PyInt_FromLong((
long) value);
26529 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
26530 return PyLong_FromUnsignedLong((
unsigned long) value);
26531 #ifdef HAVE_LONG_LONG 26532 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
26533 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
26537 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
26538 return PyInt_FromLong((
long) value);
26539 #ifdef HAVE_LONG_LONG 26540 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
26541 return PyLong_FromLongLong((PY_LONG_LONG) value);
26546 int one = 1;
int little = (int)*(
unsigned char *)&one;
26547 unsigned char *bytes = (
unsigned char *)&value;
26548 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
26549 little, !is_unsigned);
26554 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
26555 const int neg_one = (int) -1, const_zero = (
int) 0;
26556 const int is_unsigned = neg_one > const_zero;
26557 #if PY_MAJOR_VERSION < 3 26558 if (likely(PyInt_Check(x))) {
26559 if (
sizeof(
int) <
sizeof(long)) {
26560 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
26562 long val = PyInt_AS_LONG(x);
26563 if (is_unsigned && unlikely(val < 0)) {
26564 goto raise_neg_overflow;
26570 if (likely(PyLong_Check(x))) {
26572 #if CYTHON_USE_PYLONG_INTERNALS 26573 const digit* digits = ((PyLongObject*)x)->ob_digit;
26574 switch (Py_SIZE(x)) {
26575 case 0:
return (
int) 0;
26576 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
26578 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26579 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26580 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26581 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
26582 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26587 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26588 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26589 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26590 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
26591 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
26596 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26597 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26598 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26599 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
26600 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
26606 #if CYTHON_COMPILING_IN_CPYTHON 26607 if (unlikely(Py_SIZE(x) < 0)) {
26608 goto raise_neg_overflow;
26612 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26613 if (unlikely(result < 0))
26615 if (unlikely(result == 1))
26616 goto raise_neg_overflow;
26619 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
26620 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
26621 #ifdef HAVE_LONG_LONG 26622 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
26623 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26627 #if CYTHON_USE_PYLONG_INTERNALS 26628 const digit* digits = ((PyLongObject*)x)->ob_digit;
26629 switch (Py_SIZE(x)) {
26630 case 0:
return (
int) 0;
26631 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
26632 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
26634 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
26635 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26636 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26637 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26638 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26643 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
26644 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26645 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26646 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26647 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26652 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
26653 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26654 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26655 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26656 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26661 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
26662 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26663 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26664 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26665 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
26670 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
26671 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26672 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26673 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26674 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26679 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
26680 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26681 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26682 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
26683 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
26689 if (
sizeof(
int) <=
sizeof(long)) {
26690 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
26691 #ifdef HAVE_LONG_LONG 26692 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
26693 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
26698 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 26699 PyErr_SetString(PyExc_RuntimeError,
26700 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26703 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26704 #if PY_MAJOR_VERSION < 3 26705 if (likely(v) && !PyLong_Check(v)) {
26707 v = PyNumber_Long(tmp);
26712 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26713 unsigned char *bytes = (
unsigned char *)&val;
26714 int ret = _PyLong_AsByteArray((PyLongObject *)v,
26715 bytes,
sizeof(val),
26716 is_little, !is_unsigned);
26726 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26727 if (!tmp)
return (
int) -1;
26728 val = __Pyx_PyInt_As_int(tmp);
26733 PyErr_SetString(PyExc_OverflowError,
26734 "value too large to convert to int");
26736 raise_neg_overflow:
26737 PyErr_SetString(PyExc_OverflowError,
26738 "can't convert negative value to int");
26743 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
26744 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
26745 const int is_unsigned = neg_one > const_zero;
26746 #if PY_MAJOR_VERSION < 3 26747 if (likely(PyInt_Check(x))) {
26748 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
26749 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
26751 long val = PyInt_AS_LONG(x);
26752 if (is_unsigned && unlikely(val < 0)) {
26753 goto raise_neg_overflow;
26755 return (Py_intptr_t) val;
26759 if (likely(PyLong_Check(x))) {
26761 #if CYTHON_USE_PYLONG_INTERNALS 26762 const digit* digits = ((PyLongObject*)x)->ob_digit;
26763 switch (Py_SIZE(x)) {
26764 case 0:
return (Py_intptr_t) 0;
26765 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
26767 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26768 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26769 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26770 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
26771 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26776 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26777 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26778 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26779 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
26780 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26785 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26786 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26787 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26788 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
26789 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
26795 #if CYTHON_COMPILING_IN_CPYTHON 26796 if (unlikely(Py_SIZE(x) < 0)) {
26797 goto raise_neg_overflow;
26801 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26802 if (unlikely(result < 0))
26803 return (Py_intptr_t) -1;
26804 if (unlikely(result == 1))
26805 goto raise_neg_overflow;
26808 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
26809 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
26810 #ifdef HAVE_LONG_LONG 26811 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
26812 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
26816 #if CYTHON_USE_PYLONG_INTERNALS 26817 const digit* digits = ((PyLongObject*)x)->ob_digit;
26818 switch (Py_SIZE(x)) {
26819 case 0:
return (Py_intptr_t) 0;
26820 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, (sdigit) (-(sdigit)digits[0]))
26821 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
26823 if (8 *
sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
26824 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26825 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26826 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26827 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26832 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
26833 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26834 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26835 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26836 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26841 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
26842 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26843 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26844 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26845 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26850 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
26851 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26852 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26853 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26854 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26859 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
26860 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26861 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26862 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26863 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26868 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
26869 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26870 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26871 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
26872 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
26878 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
26879 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
26880 #ifdef HAVE_LONG_LONG 26881 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
26882 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
26887 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 26888 PyErr_SetString(PyExc_RuntimeError,
26889 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
26892 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
26893 #if PY_MAJOR_VERSION < 3 26894 if (likely(v) && !PyLong_Check(v)) {
26896 v = PyNumber_Long(tmp);
26901 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
26902 unsigned char *bytes = (
unsigned char *)&val;
26903 int ret = _PyLong_AsByteArray((PyLongObject *)v,
26904 bytes,
sizeof(val),
26905 is_little, !is_unsigned);
26911 return (Py_intptr_t) -1;
26915 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
26916 if (!tmp)
return (Py_intptr_t) -1;
26917 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
26922 PyErr_SetString(PyExc_OverflowError,
26923 "value too large to convert to Py_intptr_t");
26924 return (Py_intptr_t) -1;
26925 raise_neg_overflow:
26926 PyErr_SetString(PyExc_OverflowError,
26927 "can't convert negative value to Py_intptr_t");
26928 return (Py_intptr_t) -1;
26932 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
26933 const long neg_one = (long) -1, const_zero = (
long) 0;
26934 const int is_unsigned = neg_one > const_zero;
26935 #if PY_MAJOR_VERSION < 3 26936 if (likely(PyInt_Check(x))) {
26937 if (
sizeof(
long) <
sizeof(long)) {
26938 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
26940 long val = PyInt_AS_LONG(x);
26941 if (is_unsigned && unlikely(val < 0)) {
26942 goto raise_neg_overflow;
26948 if (likely(PyLong_Check(x))) {
26950 #if CYTHON_USE_PYLONG_INTERNALS 26951 const digit* digits = ((PyLongObject*)x)->ob_digit;
26952 switch (Py_SIZE(x)) {
26953 case 0:
return (
long) 0;
26954 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
26956 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
26957 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
26958 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26959 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
26960 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26965 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
26966 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
26967 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26968 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
26969 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
26974 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
26975 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
26976 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
26977 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
26978 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
26984 #if CYTHON_COMPILING_IN_CPYTHON 26985 if (unlikely(Py_SIZE(x) < 0)) {
26986 goto raise_neg_overflow;
26990 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
26991 if (unlikely(result < 0))
26993 if (unlikely(result == 1))
26994 goto raise_neg_overflow;
26997 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
26998 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
26999 #ifdef HAVE_LONG_LONG 27000 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27001 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27005 #if CYTHON_USE_PYLONG_INTERNALS 27006 const digit* digits = ((PyLongObject*)x)->ob_digit;
27007 switch (Py_SIZE(x)) {
27008 case 0:
return (
long) 0;
27009 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
27010 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
27012 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
27013 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27014 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27015 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27016 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27021 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
27022 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27023 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27024 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27025 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27030 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
27031 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27032 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27033 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27034 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27039 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
27040 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27041 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27042 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27043 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27048 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
27049 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27050 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27051 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27052 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27057 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
27058 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27059 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27060 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
27061 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
27067 if (
sizeof(
long) <=
sizeof(long)) {
27068 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
27069 #ifdef HAVE_LONG_LONG 27070 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27071 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
27076 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 27077 PyErr_SetString(PyExc_RuntimeError,
27078 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27081 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27082 #if PY_MAJOR_VERSION < 3 27083 if (likely(v) && !PyLong_Check(v)) {
27085 v = PyNumber_Long(tmp);
27090 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
27091 unsigned char *bytes = (
unsigned char *)&val;
27092 int ret = _PyLong_AsByteArray((PyLongObject *)v,
27093 bytes,
sizeof(val),
27094 is_little, !is_unsigned);
27104 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27105 if (!tmp)
return (
long) -1;
27106 val = __Pyx_PyInt_As_long(tmp);
27111 PyErr_SetString(PyExc_OverflowError,
27112 "value too large to convert to long");
27114 raise_neg_overflow:
27115 PyErr_SetString(PyExc_OverflowError,
27116 "can't convert negative value to long");
27121 static int __Pyx_check_binary_version(
void) {
27122 char ctversion[4], rtversion[4];
27123 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
27124 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
27125 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
27127 PyOS_snprintf(message,
sizeof(message),
27128 "compiletime version %s of module '%.100s' " 27129 "does not match runtime version %s",
27130 ctversion, __Pyx_MODULE_NAME, rtversion);
27131 return PyErr_WarnEx(NULL, message, 1);
27137 #ifndef __PYX_HAVE_RT_ImportModule 27138 #define __PYX_HAVE_RT_ImportModule 27139 static PyObject *__Pyx_ImportModule(
const char *name) {
27140 PyObject *py_name = 0;
27141 PyObject *py_module = 0;
27142 py_name = __Pyx_PyIdentifier_FromString(name);
27145 py_module = PyImport_Import(py_name);
27146 Py_DECREF(py_name);
27149 Py_XDECREF(py_name);
27155 #ifndef __PYX_HAVE_RT_ImportType 27156 #define __PYX_HAVE_RT_ImportType 27157 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
27158 size_t size,
int strict)
27160 PyObject *py_module = 0;
27161 PyObject *result = 0;
27162 PyObject *py_name = 0;
27164 Py_ssize_t basicsize;
27165 #ifdef Py_LIMITED_API 27166 PyObject *py_basicsize;
27168 py_module = __Pyx_ImportModule(module_name);
27171 py_name = __Pyx_PyIdentifier_FromString(class_name);
27174 result = PyObject_GetAttr(py_module, py_name);
27175 Py_DECREF(py_name);
27177 Py_DECREF(py_module);
27181 if (!PyType_Check(result)) {
27182 PyErr_Format(PyExc_TypeError,
27183 "%.200s.%.200s is not a type object",
27184 module_name, class_name);
27187 #ifndef Py_LIMITED_API 27188 basicsize = ((PyTypeObject *)result)->tp_basicsize;
27190 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
27193 basicsize = PyLong_AsSsize_t(py_basicsize);
27194 Py_DECREF(py_basicsize);
27196 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
27199 if (!strict && (
size_t)basicsize > size) {
27200 PyOS_snprintf(warning,
sizeof(warning),
27201 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
27202 module_name, class_name, basicsize, size);
27203 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
27205 else if ((
size_t)basicsize != size) {
27206 PyErr_Format(PyExc_ValueError,
27207 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
27208 module_name, class_name, basicsize, size);
27211 return (PyTypeObject *)result;
27213 Py_XDECREF(py_module);
27214 Py_XDECREF(result);
27220 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
27222 #if PY_MAJOR_VERSION < 3 27223 if (t->is_unicode) {
27224 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
27225 }
else if (t->intern) {
27226 *t->p = PyString_InternFromString(t->s);
27228 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
27231 if (t->is_unicode | t->is_str) {
27233 *t->p = PyUnicode_InternFromString(t->s);
27234 }
else if (t->encoding) {
27235 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
27237 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
27240 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
27250 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
27251 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
27253 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject* o) {
27255 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
27257 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
27258 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 27260 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
27261 __Pyx_sys_getdefaultencoding_not_ascii &&
27263 PyUnicode_Check(o)) {
27264 #if PY_VERSION_HEX < 0x03030000 27266 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
27267 if (!defenc)
return NULL;
27268 defenc_c = PyBytes_AS_STRING(defenc);
27269 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 27271 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
27273 for (c = defenc_c; c < end; c++) {
27274 if ((
unsigned char) (*c) >= 128) {
27275 PyUnicode_AsASCIIString(o);
27281 *length = PyBytes_GET_SIZE(defenc);
27284 if (__Pyx_PyUnicode_READY(o) == -1)
return NULL;
27285 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 27286 if (PyUnicode_IS_ASCII(o)) {
27287 *length = PyUnicode_GET_LENGTH(o);
27288 return PyUnicode_AsUTF8(o);
27290 PyUnicode_AsASCIIString(o);
27294 return PyUnicode_AsUTF8AndSize(o, length);
27299 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 27300 if (PyByteArray_Check(o)) {
27301 *length = PyByteArray_GET_SIZE(o);
27302 return PyByteArray_AS_STRING(o);
27307 int r = PyBytes_AsStringAndSize(o, &result, length);
27308 if (unlikely(r < 0)) {
27315 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
27316 int is_true = x == Py_True;
27317 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
27318 else return PyObject_IsTrue(x);
27320 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
27321 #if CYTHON_USE_TYPE_SLOTS 27322 PyNumberMethods *m;
27324 const char *name = NULL;
27325 PyObject *res = NULL;
27326 #if PY_MAJOR_VERSION < 3 27327 if (PyInt_Check(x) || PyLong_Check(x))
27329 if (PyLong_Check(x))
27331 return __Pyx_NewRef(x);
27332 #if CYTHON_USE_TYPE_SLOTS 27333 m = Py_TYPE(x)->tp_as_number;
27334 #if PY_MAJOR_VERSION < 3 27335 if (m && m->nb_int) {
27337 res = PyNumber_Int(x);
27339 else if (m && m->nb_long) {
27341 res = PyNumber_Long(x);
27344 if (m && m->nb_int) {
27346 res = PyNumber_Long(x);
27350 res = PyNumber_Int(x);
27353 #if PY_MAJOR_VERSION < 3 27354 if (!PyInt_Check(res) && !PyLong_Check(res)) {
27356 if (!PyLong_Check(res)) {
27358 PyErr_Format(PyExc_TypeError,
27359 "__%.4s__ returned non-%.4s (type %.200s)",
27360 name, name, Py_TYPE(res)->tp_name);
27365 else if (!PyErr_Occurred()) {
27366 PyErr_SetString(PyExc_TypeError,
27367 "an integer is required");
27371 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
27374 #if PY_MAJOR_VERSION < 3 27375 if (likely(PyInt_CheckExact(b))) {
27376 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
27377 return PyInt_AS_LONG(b);
27379 return PyInt_AsSsize_t(x);
27382 if (likely(PyLong_CheckExact(b))) {
27383 #if CYTHON_USE_PYLONG_INTERNALS 27384 const digit* digits = ((PyLongObject*)b)->ob_digit;
27385 const Py_ssize_t size = Py_SIZE(b);
27386 if (likely(__Pyx_sst_abs(size) <= 1)) {
27387 ival = likely(size) ? digits[0] : 0;
27388 if (size == -1) ival = -ival;
27393 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27394 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27398 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
27399 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27403 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27404 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27408 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
27409 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27413 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27414 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
27418 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
27419 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
27425 return PyLong_AsSsize_t(b);
27427 x = PyNumber_Index(b);
27429 ival = PyInt_AsSsize_t(x);
27433 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
27434 return PyInt_FromSize_t(ival);
double f(double C, double b, double a, int q, int r)